Skip to content

Commit

Permalink
etcdserver: rename defaultCompactionSleepInterval var (etcd-io#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]>
  • Loading branch information
JalinWang committed Aug 27, 2024
1 parent 03fcba2 commit 2c53be7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions server/storage/mvcc/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ var (
)

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 @@ -85,10 +85,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/storage/mvcc/kvstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ func newFakeStore(lg *zap.Logger) *store {
s := &store{
cfg: StoreConfig{
CompactionBatchLimit: 10000,
CompactionSleepInterval: minimumBatchInterval,
CompactionSleepInterval: defaultCompactionSleepInterval,
},
b: b,
le: &lease.FakeLessor{},
Expand Down

0 comments on commit 2c53be7

Please sign in to comment.