Skip to content

Commit

Permalink
etcdserver: rename defaultCompactionSleepInterval var (#18495)
Browse files Browse the repository at this point in the history
* etcdserver: rename `minimumBatchInterval`  to `defaultCompactionSleepInterval` and `defaultCompactBatchLimit` to `defaultCompactionBatchLimit`

Signed-off-by: Jalin Wang <[email protected]>
(cherry picked from commit 2c53be7)
  • Loading branch information
JalinWang committed Aug 29, 2024
1 parent de1efc2 commit 5b09b73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions server/mvcc/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion server/mvcc/kvstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ func newFakeStore() *store {
s := &store{
cfg: StoreConfig{
CompactionBatchLimit: 10000,
CompactionSleepInterval: minimumBatchInterval,
CompactionSleepInterval: defaultCompactionSleepInterval,
},
b: b,
le: &lease.FakeLessor{},
Expand Down

0 comments on commit 5b09b73

Please sign in to comment.