Skip to content
Snippets Groups Projects
Commit 1ff57e79 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

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.
parent ca0445de
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment