mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
storage: add comment around compact
This commit is contained in:
parent
ee47973199
commit
660fd5e3e1
@ -73,6 +73,8 @@ func (ti *treeIndex) Compact(index uint64) map[uint64]struct{} {
|
||||
available := make(map[uint64]struct{})
|
||||
emptyki := make([]*keyIndex, 0)
|
||||
log.Printf("store.index: compact %d", index)
|
||||
// TODO: do not hold the lock for long time?
|
||||
// This is probably OK. Compacting 10M keys takes O(10ms).
|
||||
ti.Lock()
|
||||
defer ti.Unlock()
|
||||
ti.tree.Ascend(compactIndex(index, available, &emptyki))
|
||||
|
Loading…
x
Reference in New Issue
Block a user