Skip to content

CNDB-16859: Use SinglePartitionReadCommand for index queries#2253

Open
adelapena wants to merge 1 commit intomainfrom
CNDB-16859-main
Open

CNDB-16859: Use SinglePartitionReadCommand for index queries#2253
adelapena wants to merge 1 commit intomainfrom
CNDB-16859-main

Conversation

@adelapena
Copy link

What is the issue

Historically all queries using indexes have been treated as a PartitionRangeReadCommand. I think was done mostly for simplicity, but it has a number of caveats:

  • There are no speculative retries for range queries. Speculative retry would help with the latency spikes described in https://github.com/riptano/cndb/issues/16823.
  • There are no digest reads. That consumes more network and it is likely detrimental for throughput.
  • Metrics and observability become more complicated because the read commands tend not to clearly show that they are single-partition.

CASSANDRA-19968 has changed this in ASF trunk so index queries targeting a single partition become SinglePartitionReadCommand. However, I think this change is not included in the current main-5.0. Probably we should bring in that change to CC too.

What does this PR fix and why was it fixed

Use SinglePartitionReadCommand for index queries for a single partition.

@adelapena adelapena self-assigned this Mar 3, 2026
@adelapena adelapena marked this pull request as draft March 3, 2026 16:07
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

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 adelapena marked this pull request as ready for review March 3, 2026 18:07
@cassci-bot
Copy link

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


41 regressions found
See build details here


Found 41 new test failures

Showing only first 15 new test failures

Test Explanation Runs Upstream
o.a.c.distributed.test.sai.GenericOrderByTest.testOrderBy REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.QueryContextTest.testSkinnyTable[fa] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.QueryContextTest.testWideTableScoreOrdered[db] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.QueryContextTest.testWideTableScoreOrdered[eb] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.QueryContextTest.testWideTableWithStatics[dc] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.QueryContextTest.testWideTableWithStatics[ec] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.QueryContextTest.testWideTableWithoutStatics[dc] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.QueryContextTest.testWideTableWithoutStatics[ec] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.cql.BM25Test.testWidePartitionWithPkPredicate[version=ec] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.cql.BM25Test.testWidePartitionWithPkPredicate[version=ed] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.cql.BM25Test.testWidePartitionWithPkPredicate[version=fa] (compression) REGRESSION 🔵🔴 0 / 19
o.a.c.index.sai.cql.VectorCompaction100dTest.testOneToManyCompaction[ec false] REGRESSION 🔴 0 / 19
o.a.c.index.sai.cql.VectorCompaction2dTest.testZeroOrOneToManyCompaction[ca false] (compression) REGRESSION 🔴🔵 0 / 19
o.a.c.index.sai.cql.VectorSiftSmallTest.testMultiSegmentBuild[ec true false] REGRESSION 🔴 0 / 19
o.a.c.index.sai.cql.VectorUpdateDeleteTest.testTTLOverwriteHasCorrectOnDiskRowCount[fa false true] (compression) REGRESSION 🔵🔴 0 / 19

Found 7 known test failures

@sonarqubecloud
Copy link

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.

2 participants