mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
storage: avoid one extra round of wait
It could exit early if it knows that there is no more keys.
This commit is contained in:
parent
9175df7c71
commit
5ae2eb4731
@ -31,7 +31,7 @@ func (s *store) scheduleCompaction(compactMainRev int64, keep map[revision]struc
|
||||
}
|
||||
}
|
||||
|
||||
if len(keys) == 0 {
|
||||
if len(keys) < int(batchsize) {
|
||||
rbytes := make([]byte, 8+1+8)
|
||||
revToBytes(revision{main: compactMainRev}, rbytes)
|
||||
tx.UnsafePut(metaBucketName, finishedCompactKeyName, rbytes)
|
||||
|
Loading…
x
Reference in New Issue
Block a user