diff --git a/CHANGELOG.md b/CHANGELOG.md index e24822d1..dfb69e5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ Changelog for NeoFS Node ## [Unreleased] +### Fixed +- Storage Node handles requests before its initialization is finished (#934) + ## [0.26.0] - 2021-10-19 - Udo (우도, 牛島) NeoFS API v2.10 support diff --git a/cmd/neofs-node/netmap.go b/cmd/neofs-node/netmap.go index 628162fe..88c372b2 100644 --- a/cmd/neofs-node/netmap.go +++ b/cmd/neofs-node/netmap.go @@ -90,6 +90,8 @@ func initNetmapService(c *cfg) { initMorphComponents(c) } + initNetmapState(c) + server := netmapTransportGRPC.New( netmapService.NewSignService( &c.key.PrivateKey, @@ -162,9 +164,9 @@ func initNetmapService(c *cfg) { } } +// bootstrapNode adds current node to the Network map. +// Must be called after initNetmapService. func bootstrapNode(c *cfg) { - initState(c) - if c.needBootstrap() { err := c.bootstrap() fatalOnErrDetails("bootstrap error", err) @@ -191,7 +193,9 @@ func setNetmapNotificationParser(c *cfg, sTyp string, p event.NotificationParser c.cfgNetmap.parsers[typ] = p } -func initState(c *cfg) { +// initNetmapState inits current Network map state. +// Must be called after Morph components initialization. +func initNetmapState(c *cfg) { epoch, err := c.cfgNetmap.wrapper.Epoch() fatalOnErrDetails("could not initialize current epoch number", err)