vinyl: do not remove empty range on split
Successful merge+split may result in ranges w/o tuples. Before commit 559102a7 ("vinyl: store range lower and upper bounds on disk") it was OK to delete such ranges, because there was no range->end. To illustrate this, suppose compaction splits a range as follows: [A, C) => [A, B) + [B, C) If range [B, C) turns out to be empty, then we could simply drop it as all inserts would go to range [A, B) and as B was not stored anywhere, it would effectively become range [A, C). After the above-mentioned commit, however, removal of range [B, C) breaks the index invariant that for each two adjacent ranges prev->end always equals next->begin. This, in turn, can result in data loss in case [A, B) gets split again, as B will be used to break the run write loop (see vy_range_compact_execute()) which is premature since there may be tuples >= B. That being said, let's remove this small optimization altogether.
Loading
Please register or sign in to comment