diff --git a/ingest.go b/ingest.go index e650ac7702..11e3d759ef 100644 --- a/ingest.go +++ b/ingest.go @@ -1751,7 +1751,8 @@ func (d *DB) excise( smallestPointKey.UserKey = firstRangeDel rightFile.ExtendPointKeyBounds(d.cmp, smallestPointKey, largestPointKey) } - } else if m.HasRangeKeys && !exciseSpan.Contains(d.cmp, m.LargestRangeKey) { + } + if m.HasRangeKeys && !exciseSpan.Contains(d.cmp, m.LargestRangeKey) { // This file will contain range keys. largestRangeKey := m.LargestRangeKey if rangeKeyIter == nil { diff --git a/ingest_test.go b/ingest_test.go index 38c063e590..a002fff707 100644 --- a/ingest_test.go +++ b/ingest_test.go @@ -602,6 +602,7 @@ func TestExcise(t *testing.T) { flushed = true }}, FormatMajorVersion: FormatVirtualSSTables, + Comparer: testkeys.Comparer, } // Disable automatic compactions because otherwise we'll race with // delete-only compactions triggered by ingesting range tombstones. diff --git a/testdata/excise b/testdata/excise index b1ee9bb230..5bdce57110 100644 --- a/testdata/excise +++ b/testdata/excise @@ -162,3 +162,37 @@ would excise 2 files, use ingest-and-excise to excise. added: L0 000009:[b#11,SET-b#11,SET] seqnums:[11-11] points:[b#11,SET-b#11,SET] added: L0 000010:[g#11,RANGEDEL-i#inf,RANGEDEL] seqnums:[11-11] points:[g#11,RANGEDEL-i#inf,RANGEDEL] added: L6 000011:[d#10,RANGEKEYSET-f#inf,RANGEKEYSET] seqnums:[10-10] ranges:[d#10,RANGEKEYSET-f#inf,RANGEKEYSET] + +reset +---- + +# Create an sstable with a range key set. +batch +set a a +set b b +set d d +range-key-set e ee @1 foo +---- + +flush +---- + +lsm +---- +0.0: + 000005:[a#10,SET-ee#inf,RANGEKEYSET] + +build ext2 +set z z +---- + +ingest-and-excise ext2 excise=b-c +---- + +lsm +---- +0.0: + 000007:[a#10,SET-a#10,SET] + 000008:[d#12,SET-ee#inf,RANGEKEYSET] +6: + 000006:[z#14,SET-z#14,SET]