Apply reload tombstones in batches

This keeps some memory bounds when reloading a TSM files tombstones
so that the heap does not grow exceedintly fast and stay there
after the deletes are applied.
pull/7084/head
Jason Wilder 2016-07-26 16:40:56 -06:00
parent 4436e65fb9
commit ef8ecf0e90
1 changed files with 2 additions and 2 deletions

View File

@ -203,7 +203,7 @@ func NewTSMReader(f *os.File) (*TSMReader, error) {
func (t *TSMReader) applyTombstones() error {
var cur, prev Tombstone
batch := make([]string, 0, 1024)
batch := make([]string, 0, 4096)
if err := t.tombstoner.Walk(func(ts Tombstone) error {
cur = ts
@ -215,7 +215,7 @@ func (t *TSMReader) applyTombstones() error {
}
batch = append(batch, ts.Key)
if len(batch) > 1024 {
if len(batch) > 4096 {
t.index.DeleteRange(batch, prev.Min, prev.Max)
batch = batch[:0]
}