You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Caleb Rackliffe (Jira)" <ji...@apache.org> on 2023/10/20 20:10:00 UTC

[jira] [Comment Edited] (CASSANDRA-18896) ClientRequestSize metrics should not treat CONTAINS restrictions as being equality-based

    [ https://issues.apache.org/jira/browse/CASSANDRA-18896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17777480#comment-17777480 ] 

Caleb Rackliffe edited comment on CASSANDRA-18896 at 10/20/23 8:09 PM:
-----------------------------------------------------------------------

5.0: [https://github.com/apache/cassandra/pull/2829]

trunk: [https://github.com/apache/cassandra/pull/2831]


was (Author: maedhroz):
5.0 patch: [https://github.com/apache/cassandra/pull/2829]

> ClientRequestSize metrics should not treat CONTAINS restrictions as being equality-based
> ----------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18896
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18896
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Observability/Metrics
>            Reporter: Caleb Rackliffe
>            Assignee: Caleb Rackliffe
>            Priority: Normal
>             Fix For: 5.0-alpha2, 5.1
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The following behavior needs to be changed to consider the column restricted by {{CONTAINS}} or {{CONTAINS KEY}} as "read", rather than "provided by the client". We already do this for things like range restrictions, and the current behavior is inconsistent.
> {noformat}
> @Test
> public void shouldRecordReadMetricsForContainsQuery() throws Throwable
> {
>     createTable("CREATE TABLE %s (pk int, ck int, v set<int>, PRIMARY KEY (pk, ck))");
>     executeNet(CURRENT, "INSERT INTO %s (pk, ck, v) VALUES (1, 1, {1, 2, 3} )");
>     executeNet(CURRENT, "INSERT INTO %s (pk, ck, v) VALUES (2, 2, {4, 5, 6})");
>     executeNet(CURRENT, "SELECT * FROM %s WHERE v CONTAINS 1 ALLOW FILTERING");
>     assertEquals(1, ClientRequestSizeMetrics.totalRowsRead.getCount());
>     // The filtering term is provided by the client in the request, so we don't consider that column read.
>     assertEquals(2, ClientRequestSizeMetrics.totalColumnsRead.getCount());
> }
> {noformat}
> The fix should be literally two lines, one in {{SingleRestriction}} and one in the test above.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org