forked from TrueCloudLab/frostfs-node
[#968] adm: Allow concurrent epoch ticks
Previous fix was incomplete, there are two possible places for this error to occur. Refs #592 Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
cfc5ce7853
commit
053a195ac2
1 changed files with 6 additions and 10 deletions
|
@ -37,19 +37,15 @@ func forceNewEpochCmd(cmd *cobra.Command, _ []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := wCtx.sendConsensusTx(bw.Bytes()); err != nil {
|
||||
return err
|
||||
if err = wCtx.sendConsensusTx(bw.Bytes()); err == nil {
|
||||
err = wCtx.awaitTx()
|
||||
}
|
||||
|
||||
if err := wCtx.awaitTx(); err != nil {
|
||||
if strings.Contains(err.Error(), "invalid epoch") {
|
||||
if err != nil && strings.Contains(err.Error(), "invalid epoch") {
|
||||
cmd.Println("Epoch has already ticked.")
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func emitNewEpochCall(bw *io.BufBinWriter, wCtx *initializeContext, nmHash util.Uint160) error {
|
||||
curr, err := unwrap.Int64(wCtx.ReadOnlyInvoker.Call(nmHash, "epoch"))
|
||||
|
|
Loading…
Reference in a new issue