[#1024] shard: Resync metabase concurrently

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-03-05 15:39:50 +03:00
parent 1005bf4f56
commit 57466594fb
10 changed files with 93 additions and 39 deletions

View file

@ -95,7 +95,8 @@ type MetricsWriter interface {
type cfg struct {
m sync.RWMutex
refillMetabase bool
refillMetabase bool
refillMetabaseWorkersCount int
rmBatchSize int
@ -300,6 +301,13 @@ func WithRefillMetabase(v bool) Option {
}
}
// WithRefillMetabaseWorkersCount returns option to set count of workers to refill the Metabase on Shard's initialization step.
func WithRefillMetabaseWorkersCount(v int) Option {
return func(c *cfg) {
c.refillMetabaseWorkersCount = v
}
}
// WithMode returns option to set shard's mode. Mode must be one of the predefined:
// - mode.ReadWrite;
// - mode.ReadOnly.