Skip to content

Conversation

@michaelsembwever
Copy link
Member

@michaelsembwever michaelsembwever commented Nov 17, 2025

https://github.com/riptano/cndb/issues/16023

Port into main-5.0 commit 27689d3

CNDB-16023: CNDB-15260: Add SAI-specific execution info to slow query logger
Adds the metrics in IndexContext and the tree view of the query's Plan to the log messages produced for slow SAI queries.

There is a new system property named cassandra.sai.slow_query_log.execution_info_enabled to toggle this feature, which is enabled by default. This property can be changed dynamically at any time, without a restart.

When SAI-specific information is added to the slow query logger, the log messages for slow queries can take up almost 10x the (uncompressed) disk space. In the worst of the worst cases, with all queries being permanently slower than 500ms, and at least 50 different queries, reporting every 5 seconds (the default), the slow query logger can produce around 120MB of text per day and instance. With the detailed logging, it would be 1.14GB per day.

BLOCKED on https://github.com/riptano/cndb/issues/16021

@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

@michaelsembwever michaelsembwever marked this pull request as draft November 19, 2025 22:39
@michaelsembwever michaelsembwever force-pushed the mck-cndb-16023-main-5.0 branch 3 times, most recently from 270faac to 3f621fb Compare December 8, 2025 14:07
@michaelsembwever michaelsembwever marked this pull request as ready for review December 8, 2025 18:48
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

Copy link

@adelapena adelapena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I see that the properties SLOW_QUERY_LOG_MONITORING_REPORT_INTERVAL_IN_MS and SLOW_QUERY_LOG_MONITORING_MAX_OPERATIONS haven't been added because they already existed in 5.0 as MONITORING_REPORT_INTERVAL_MS and MONITORING_MAX_OPERATIONS, which is fine. Probably we should rename them in CC main to adopt the 5.0 form. I'll do that in CNDB-16237.

… logger (#2044)

Adds the metrics in IndexContext and the tree view of the query's Plan
to the log messages produced for slow SAI queries.

There is a new system property named cassandra.sai.slow_query_log.execution_info_enabled
to toggle this feature, which is enabled by default. This property can be changed
dynamically at any time, without a restart.

When SAI-specific information is added to the slow query logger, the log messages for
slow queries can take up almost 10x the (uncompressed) disk space. In the worst of the
worst cases, with all queries being permanently slower than 500ms, and at least 50
different queries, reporting every 5 seconds (the default), the slow query logger can
produce around 120MB of text per day and instance. With the detailed logging, it would
be 1.14GB per day.
@michaelsembwever
Copy link
Member Author

I see that the properties SLOW_QUERY_LOG_MONITORING_REPORT_INTERVAL_IN_MS and SLOW_QUERY_LOG_MONITORING_MAX_OPERATIONS haven't been added because they already existed in 5.0 as MONITORING_REPORT_INTERVAL_MS and MONITORING_MAX_OPERATIONS, which is fine. Probably we should rename them in CC main to adopt the 5.0 form. I'll do that in https://github.com/riptano/cndb/issues/16237.

The agreement is to avoid unnecessary refactorings in CC.
ref: https://datastax.slack.com/archives/C07JQKRP2DB/p1764682685913719?thread_ts=1764680442.147439&cid=C07JQKRP2DB

Such changes should be made upstream rather than in CC.

@michaelsembwever michaelsembwever merged commit 0077e1d into main-5.0 Dec 9, 2025
424 of 518 checks passed
@michaelsembwever michaelsembwever deleted the mck-cndb-16023-main-5.0 branch December 9, 2025 17:13
@adelapena
Copy link

I see that the properties SLOW_QUERY_LOG_MONITORING_REPORT_INTERVAL_IN_MS and SLOW_QUERY_LOG_MONITORING_MAX_OPERATIONS haven't been added because they already existed in 5.0 as MONITORING_REPORT_INTERVAL_MS and MONITORING_MAX_OPERATIONS, which is fine. Probably we should rename them in CC main to adopt the 5.0 form. I'll do that in https://github.com/riptano/cndb/issues/16237.

The agreement is to avoid unnecessary refactorings in CC.
ref: https://datastax.slack.com/archives/C07JQKRP2DB/p1764682685913719?thread_ts=1764680442.147439&cid=C07JQKRP2DB

Such changes should be made upstream rather than in CC.

Probably unnecessary refactorings should be avoided everywhere :)

This is the other way around, changing the name of the properties in CC to adapt to ASF/CC5.

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.

4 participants