Skip to content

Commit

Permalink
Merge pull request #19411 from k8s-infra-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-19410-to-release-3.6

[release-3.6] Fix a performance regression due to uncertain compaction sleep interval
  • Loading branch information
serathius authored Feb 13, 2025
2 parents 302f21d + 61ca409 commit 73c75b3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/storage/mvcc/kvstore_compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ func (s *store) scheduleCompaction(compactMainRev, prevCompactRev int64) (KeyVal
binary.BigEndian.PutUint64(end, uint64(compactMainRev+1))

batchNum := s.cfg.CompactionBatchLimit
batchTicker := time.NewTicker(s.cfg.CompactionSleepInterval)
defer batchTicker.Stop()
h := newKVHasher(prevCompactRev, compactMainRev, keep)
last := make([]byte, 8+1+8)
for {
Expand Down Expand Up @@ -91,7 +89,7 @@ func (s *store) scheduleCompaction(compactMainRev, prevCompactRev int64) (KeyVal
dbCompactionPauseMs.Observe(float64(time.Since(start) / time.Millisecond))

select {
case <-batchTicker.C:
case <-time.After(s.cfg.CompactionSleepInterval):
case <-s.stopc:
return KeyValueHash{}, fmt.Errorf("interrupted due to stop signal")
}
Expand Down

0 comments on commit 73c75b3

Please sign in to comment.