Skip to content

Conversation

@adelapena
Copy link

What is the issue

CNDB-15260 added SAI-specific execution information to the log reports produced for slow queries, and CNDB-15260 will soon add generic execution information for all non-SAI read commands. These details are produced only for queries that are reported as slow but successful by MonitoringTask. However, MonitoringTask also produces log reports for queries that are slow enough to be aborted. We should probably also add execution information to the log reports for aborted queries.

What does this PR fix and why was it fixed

Adds execution information to the log reports for aborted queries. The extension of the log messages is identical to what we did for slow successful queries in CNDB-15260 and CNDB-15260, but applied to aborted queries:

2025-12-11 16:00:09,398 MonitoringTask.java:144 - 1 operations timed out in the last 112 msecs:
<SELECT * FROM distributed_test_keyspace.t_88 ALLOW FILTERING>, total time 211 msec, timeout 100 msec/cross-node
  Fetched/returned/tombstones:
    partitions: 1/1/0
    rows: 2/2/0
2025-12-11 16:00:12,871 MonitoringTask.java:144 - 1 operations timed out in the last 104 msecs:
<SELECT * FROM distributed_test_keyspace.t_88 WHERE s = ? ALLOW FILTERING>, total time 245 msec, timeout 100 msec/cross-node
  SAI slow query metrics:
    sstablesHit: 3
    segmentsHit: 3
    keysFetched: 10
    partitionsFetched: 1
    partitionsReturned: 1
    partitionTombstonesFetched: 1
    rowsFetched: 3
    rowsReturned: 3
    rowTombstonesFetched: 4
    trieSegmentsHit: 0
    bkdPostingListsHit: 3
    bkdSegmentsHit: 3
    bkdPostingsSkips: 0
    bkdPostingsDecodes: 0
    triePostingsSkips: 0
    triePostingsDecodes: 0
    annGraphSearchLatencyNanos: 0
  SAI slow query plan:
    Limit 2147483647 (rows: 50.0, cost/row: 101.6, cost: 4500.0..9582.0)
     └─ Filter s = ? (sel: 1.000000000) (rows: 50.0, cost/row: 101.6, cost: 4500.0..9582.0)
         └─ Fetch (rows: 50.0, cost/row: 101.6, cost: 4500.0..9582.0)
             └─ NumericIndexScan of sai_idx (sel: 0.500000000, step: 1.0) (keys: 50.0, cost/key: 0.1, cost: 4500.0..4505.0)
                predicate: Expression{name: s, op: EQ, lower: (0, true), upper: (0, true), exclusions: []}

This also renames the CassandraRelevantProperties related to monitoring, to align them with ASF/CC5. The renames are:

  • SLOW_QUERY_LOG_MONITORING_REPORT_INTERVAL_IN_MS -> MONITORING_REPORT_INTERVAL_MS
  • SLOW_QUERY_LOG_MONITORING_MAX_OPERATIONS -> MONITORING_MAX_OPERATIONS
  • SLOW_QUERY_LOG_EXECUTION_INFO_ENABLED -> MONITORING_EXECUTION_INFO_ENABLED
  • SAI_SLOW_QUERY_LOG_EXECUTION_INFO_ENABLED -> SAI_MONITORING_EXECUTION_INFO_ENABLED

This naming also makes more sense considering that monitoring is applied to both slow and aborted queries.

Please note that the real underlying system properties are unchanged, and this only renames their enum names.
All four enums are not present in any CC release yet.

@adelapena adelapena self-assigned this Dec 17, 2025
@github-actions
Copy link

Checklist before you submit for review

  • This PR adheres to the Definition of Done
  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits
  • All new files should contain the DataStax copyright header instead of the Apache License one

@adelapena
Copy link
Author

This PR is a duplicate of #2172 to see if the failures of the Sonar job have anything to do with the base branch name, or some other saved status.

@cassci-bot
Copy link

❌ Build ds-cassandra-pr-gate/PR-2182 rejected by Butler


1 regressions found
See build details here


Found 1 new test failures

Test Explanation Runs Upstream
o.a.c.index.sai.cql.VectorCompaction100dTest.testOneToManyCompactionTooManyHoles[dc false] NEW 🔴 0 / 19

Found 1 known test failures

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.

3 participants