From 1303320377eb511f40222f5f2aa0d9ecd19b7359 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Fri, 8 Dec 2017 10:01:37 +0100 Subject: [PATCH] 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. --- partition_version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partition_version.cc b/partition_version.cc index 50dea025ea..3141cf742c 100644 --- a/partition_version.cc +++ b/partition_version.cc @@ -572,7 +572,7 @@ partition_snapshot::range_tombstones(const ::schema& s, position_in_partition_vi list.apply(s, rt); } } - return boost::copy_range>(list); + return boost::copy_range>(list.slice(s, start, end)); } std::ostream& operator<<(std::ostream& out, partition_entry& e) {