Skip to content

CASSANDRA-21623 Report the number of rows replica filtering protection cached when it warns - #5162

Open
AhmedReda85 wants to merge 1 commit into
apache:trunkfrom
AhmedReda85:CASSANDRA-21623
Open

CASSANDRA-21623 Report the number of rows replica filtering protection cached when it warns#5162
AhmedReda85 wants to merge 1 commit into
apache:trunkfrom
AhmedReda85:CASSANDRA-21623

Conversation

@AhmedReda85

Copy link
Copy Markdown

Description

Previously, ReplicaFilteringProtection emitted a warning immediately upon crossing cachedRowsWarnThreshold + 1, reporting the threshold value rather than the actual maximum number of rows cached during the query.

This patch:

  • Defers warning evaluation to QueryMergeListener.close() so the peak cached count (maxRowsCached) across the entire query is reported.
  • Updates the warning message to:
    "Replica filtering protection has cached up to %d rows during query %s, which is over the warning threshold of %d rows defined by 'cached_replica_rows_warn_threshold' in cassandra.yaml."
  • Suppresses the warning if the query already failed due to hitting cachedRowsFailThreshold (hitFailureThreshold = true).
  • Updates failure message to clearly report currentRowsCached and cachedRowsFailThreshold.
  • Adds entry to CHANGES.txt under 7.0.

Jira

Testing

  • Updated ReplicaFilteringProtectionTest using AssertJ fluent assertions to verify the exact warning and failure messages.
  • Ran targeted distributed test:
    ant test-jvm-dtest-some -Dtest.name=org.apache.cassandra.distributed.test.ReplicaFilteringProtectionTest (BUILD SUCCESSFUL).
  • Passed git diff --check with zero whitespace errors.

… warns

 patch by Ahmed Reda; reviewed by <Reviewer> for CASSANDRA-21623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant