Michael Semb Wever created CASSANDRA-21623:
----------------------------------------------

             Summary: Report the number of rows replica filtering protection 
cached when it warns
                 Key: CASSANDRA-21623
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21623
             Project: Apache Cassandra
          Issue Type: Improvement
          Components: Consistency/Coordination
            Reporter: Michael Semb Wever


Replica filtering protection warns when it caches more rows than 
{{cached_replica_rows_warn_threshold}}:

{code}
Replica filtering protection has cached over 5 rows during query SELECT * FROM 
ks.tbl WHERE v = 'old' LIMIT 9 ALLOW FILTERING. (See 
'cached_replica_rows_warn_threshold' in cassandra.yaml.)
{code}

The message names the threshold, not the number of rows cached, so an operator 
cannot tell a query that went one row over from one that went a thousand rows 
over. The two need different responses: the first argues for raising the 
threshold, the second for fixing the query.

The warning is also raised as the count crosses the threshold, which is before 
the query reaches its high watermark, and the count the warning would want is 
not known until the query ends.

The patch moves the warning to the end of the query, where {{maxRowsCached}} is 
the high watermark the metric already records, and names that number:

{code}
Replica filtering protection has cached up to 6 rows during query SELECT * FROM 
ks.tbl WHERE v = 'old' LIMIT 9 ALLOW FILTERING, which is over the warning 
threshold of 5 rows defined by 'cached_replica_rows_warn_threshold' in 
cassandra.yaml.
{code}

The failure message gains the count the same way. The failure threshold stays 
on every increment, so an overloaded query still aborts at the row that crosses 
it, and the warning is suppressed once the failure has fired, so one query 
raises one message.

The {{hitWarningThreshold}} field goes away, and its comment with it: the 
comment claimed the field tracked a partition, while nothing ever reset it, so 
the warning was already once per query.

Patch: 
[mck/upstream/rfp-cached-rows-warning/trunk|https://github.com/thelastpickle/cassandra/tree/mck/upstream/rfp-cached-rows-warning/trunk]
Provenance: 
[b8bd9b19ce|https://github.com/datastax/cassandra/commit/b8bd9b19ce72c4f4d1f912ccc03fd62a59cbd2fc]
 by [~adelapena]. That commit left a commented-out duplicate line in the test, 
which this patch drops.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to