Skip to content

Commit f1223ec

Browse files
authored
CNDB-16277: Fix TombstoneOverwhelmingException being swallowed when tracking warnings (#2171)
### What is the issue ReadCommandVerbHandler was catching RejectException and returning an empty response instead of propagating the failure when warnings tracking was enabled. ### What does this PR fix and why was it fixed TombstoneOverwhelmingException is always re-thrown regardless of warning tracking state.
1 parent 773fd4a commit f1223ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.slf4j.LoggerFactory;
2424

2525
import org.apache.cassandra.config.DatabaseDescriptor;
26+
import org.apache.cassandra.db.filter.TombstoneOverwhelmingException;
2627
import org.apache.cassandra.db.partitions.UnfilteredPartitionIterator;
2728
import org.apache.cassandra.dht.Token;
2829
import org.apache.cassandra.exceptions.InvalidRequestException;
@@ -123,7 +124,10 @@ public void doVerb(Message<ReadCommand> message)
123124
}
124125
catch (RejectException e)
125126
{
126-
if (!command.isTrackingWarnings())
127+
// TombstoneOverwhelmingException should always be propagated as a failure,
128+
// even when tracking warnings, as it indicates a guardrail violation that
129+
// must be reported to the client
130+
if (!command.isTrackingWarnings() || e instanceof TombstoneOverwhelmingException)
127131
throw e;
128132

129133
// make sure to log as the exception is swallowed

0 commit comments

Comments
 (0)