etcdserver: rename defaultCompactionSleepInterval var (#18495)

* etcdserver: rename `minimumBatchInterval`  to `defaultCompactionSleepInterval` and `defaultCompactBatchLimit` to `defaultCompactionBatchLimit`

Signed-off-by: Jalin Wang <JalinWang@outlook.com>
This commit is contained in:
Jalin Wang 2024-08-27 21:36:06 +08:00 committed by GitHub
parent 03fcba2940
commit 2c53be7c5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -39,8 +39,8 @@ var (
) )
var restoreChunkKeys = 10000 // non-const for testing var restoreChunkKeys = 10000 // non-const for testing
var defaultCompactBatchLimit = 1000 var defaultCompactionBatchLimit = 1000
var minimumBatchInterval = 10 * time.Millisecond var defaultCompactionSleepInterval = 10 * time.Millisecond
type StoreConfig struct { type StoreConfig struct {
CompactionBatchLimit int CompactionBatchLimit int
@ -85,10 +85,10 @@ func NewStore(lg *zap.Logger, b backend.Backend, le lease.Lessor, cfg StoreConfi
lg = zap.NewNop() lg = zap.NewNop()
} }
if cfg.CompactionBatchLimit == 0 { if cfg.CompactionBatchLimit == 0 {
cfg.CompactionBatchLimit = defaultCompactBatchLimit cfg.CompactionBatchLimit = defaultCompactionBatchLimit
} }
if cfg.CompactionSleepInterval == 0 { if cfg.CompactionSleepInterval == 0 {
cfg.CompactionSleepInterval = minimumBatchInterval cfg.CompactionSleepInterval = defaultCompactionSleepInterval
} }
s := &store{ s := &store{
cfg: cfg, cfg: cfg,

View File

@ -917,7 +917,7 @@ func newFakeStore(lg *zap.Logger) *store {
s := &store{ s := &store{
cfg: StoreConfig{ cfg: StoreConfig{
CompactionBatchLimit: 10000, CompactionBatchLimit: 10000,
CompactionSleepInterval: minimumBatchInterval, CompactionSleepInterval: defaultCompactionSleepInterval,
}, },
b: b, b: b,
le: &lease.FakeLessor{}, le: &lease.FakeLessor{},