Description
This issue can be reproduced in cqlsh:
create table test1( a int, b int, primary key(a,b)); INSERT INTO test1(a,b) values (1,1); INSERT INTO test1(a,b) values (1,2); INSERT INTO test1(a,b) values (1,3); INSERT INTO test1(a,b) values (1,4); INSERT INTO test1(a,b) values (1,5); INSERT INTO test1(a,b) values (1,6); -- flush memtable here delete from test1 where a=1 and b=6; INSERT INTO test1(a,b) values (2,2); -- flush memtable here select * from test1 where a=1 and b=6; a | b ---+--- 1 | 6
Voila!
The problem is in columnStats accounting for min and max columns names. range tombstones are not accounted there, so sstables get omitted on slice query read, if they have only range thombsones in some range.
Also while debugged this found a problem in LazilyCompactedRow: RangeThombstones processing of timestamps histogram were implemented wrong in CASSANDRA-6522 - no range thobmstones are actuallu accessible in deletionInfo().rangeIterator(), so fixed it as well.