forked from TrueCloudLab/frostfs-node
[#1110] node: Use single handler for new epoch event
Bootstrap logic depends on the netmap status, which in turn depends on the node info. Updating them in a single thread makes things more predictable. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
4b514f5ba0
commit
52bebe9452
2 changed files with 17 additions and 17 deletions
|
@ -1165,6 +1165,18 @@ func (c *cfg) setContractNodeInfo(ni *netmap.NodeInfo) {
|
|||
c.cfgNetmap.state.setNodeInfo(ni)
|
||||
}
|
||||
|
||||
func (c *cfg) updateContractNodeInfo(epoch uint64) {
|
||||
ni, err := c.netmapLocalNodeState(epoch)
|
||||
if err != nil {
|
||||
c.log.Error(logs.FrostFSNodeCouldNotUpdateNodeStateOnNewEpoch,
|
||||
zap.Uint64("epoch", epoch),
|
||||
zap.String("error", err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
c.setContractNodeInfo(ni)
|
||||
}
|
||||
|
||||
// bootstrapWithState calls "addPeer" method of the Sidechain Netmap contract
|
||||
// with the binary-encoded information from the current node's configuration.
|
||||
// The state is set using the provided setter which MUST NOT be nil.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue