File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/java/org/apache/cassandra/db/compaction Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ class StatefulCursor extends SSTableCursorReader
5252 private boolean resetAfterDone = false ;
5353 private long bytesReadPositionSnapshot = 0 ;
5454
55+ private boolean isOpenRangeTombstonePresent = false ;
56+
5557 public StatefulCursor (SSTableReader reader )
5658 {
5759 super (reader );
@@ -176,8 +178,17 @@ public void readRowHeader()
176178 public void readTombstoneMarker ()
177179 {
178180 super .readTombstoneMarker (unfiltered );
181+
179182 if (corruptedTombstoneValidationEnabled )
180183 validateInvalidTombstoneDeletion ();
184+
185+ boolean isStartBound = unfiltered .isStartBound ();
186+ if (isOpenRangeTombstonePresent && isStartBound )
187+ corruptSSTable ("Encountered an open range tombstone marker before the prev was closed: " + unfiltered );
188+ if (!isOpenRangeTombstonePresent && !isStartBound )
189+ corruptSSTable ("Encountered an close/boundary range tombstone marker before an open one: " + unfiltered );
190+ isOpenRangeTombstonePresent = isStartBound || unfiltered .isBoundary ();
191+ // TODO: can also add verification of open/close timestamp match
181192 }
182193
183194 public void readStaticRowHeader ()
You can’t perform that action at this time.
0 commit comments