Skip to content

Commit

Permalink
engine: support reloading shard_pool_size with SIGHUP
Browse files Browse the repository at this point in the history
Refs #1770.

Signed-off-by: Andrey Butusov <[email protected]>
  • Loading branch information
End-rey committed Nov 21, 2024
1 parent f1b6982 commit b13fa5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/neofs-node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ func (c *cfg) configWatcher(ctx context.Context) {
for _, optsWithID := range c.shardOpts() {
rcfg.AddShard(optsWithID.configID, optsWithID.shOpts)
}
rcfg.SetShardPoolSize(c.engine.shardPoolSize)

err = c.cfgObject.cfgLocalStorage.localStorage.Reload(rcfg)
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions pkg/local_object_storage/engine/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,19 @@ func (rCfg *ReConfiguration) AddShard(id string, opts []shard.Option) {

// Reload reloads StorageEngine's configuration in runtime.
func (e *StorageEngine) Reload(rcfg ReConfiguration) error {
e.mtx.Lock()
e.shardPoolSize = rcfg.shardPoolSize
e.mtx.Unlock()

type reloadInfo struct {
sh *shard.Shard
opts []shard.Option
}

e.mtx.RLock()
for _, pool := range e.shardPools {
pool.Tune(int(e.shardPoolSize))
}

var shardsToRemove []string // shards IDs
var shardsToAdd []string // shard config identifiers (blobstor paths concatenation)
Expand Down

0 comments on commit b13fa5a

Please sign in to comment.