diff --git a/server/mvcc/kvstore.go b/server/mvcc/kvstore.go index 7719a93f38e2..fb81af6ec747 100644 --- a/server/mvcc/kvstore.go +++ b/server/mvcc/kvstore.go @@ -50,8 +50,8 @@ const ( ) var restoreChunkKeys = 10000 // non-const for testing -var defaultCompactBatchLimit = 1000 -var minimumBatchInterval = 10 * time.Millisecond +var defaultCompactionBatchLimit = 1000 +var defaultCompactionSleepInterval = 10 * time.Millisecond type StoreConfig struct { CompactionBatchLimit int @@ -96,10 +96,10 @@ func NewStore(lg *zap.Logger, b backend.Backend, le lease.Lessor, cfg StoreConfi lg = zap.NewNop() } if cfg.CompactionBatchLimit == 0 { - cfg.CompactionBatchLimit = defaultCompactBatchLimit + cfg.CompactionBatchLimit = defaultCompactionBatchLimit } if cfg.CompactionSleepInterval == 0 { - cfg.CompactionSleepInterval = minimumBatchInterval + cfg.CompactionSleepInterval = defaultCompactionSleepInterval } s := &store{ cfg: cfg, diff --git a/server/mvcc/kvstore_test.go b/server/mvcc/kvstore_test.go index 52c819810a75..612362d737b5 100644 --- a/server/mvcc/kvstore_test.go +++ b/server/mvcc/kvstore_test.go @@ -912,7 +912,7 @@ func newFakeStore() *store { s := &store{ cfg: StoreConfig{ CompactionBatchLimit: 10000, - CompactionSleepInterval: minimumBatchInterval, + CompactionSleepInterval: defaultCompactionSleepInterval, }, b: b, le: &lease.FakeLessor{},