mvcc: Fix partition_snapshot::range_tombstones()

partition_snapshot::range_tombstones() is deoverlapping tombstones
coming from different versions and it may happen that due to range
tombstone splitting the method will return a tombstone which starts
after the requested range. This would cause it to return a tombstone
which doesn't overlap with the requested range.

This breaks assumptions made by cache reader. It keeps track of the
maximum fragment position, and if cache reader will then need to read
from sstables due to a miss, it would do so starting from the position
marked by that out of range tombstone, possibly skipping over some
rows.

Exposed by a change in row_cache_test.cc::test_mvcc() which fills the
buffer of sm5 reader after it is created.

Fixes #3053.
This commit is contained in:
Tomasz Grabiec
2017-12-08 10:01:37 +01:00
parent 89e3b734ed
commit 1303320377

View File

@@ -572,7 +572,7 @@ partition_snapshot::range_tombstones(const ::schema& s, position_in_partition_vi
list.apply(s, rt);
}
}
return boost::copy_range<std::vector<range_tombstone>>(list);
return boost::copy_range<std::vector<range_tombstone>>(list.slice(s, start, end));
}
std::ostream& operator<<(std::ostream& out, partition_entry& e) {