Skip to content

Conversation

@driftx
Copy link

@driftx driftx commented Dec 12, 2025

What is the issue

Currently maxIncludedOrExcludedIndexCount is using getSecondaryIndexesPerTableFailThreshold but the coordinator will always validate that the indexes mentioned by the index hints exist in the schema, and there cannot be repeated index in the hints because the hints are disjoint sets. So the number of index hints is implicitly limited by the number of existing indexes, therefore we should use Short.MAX_VALUE like main does.

What does this PR fix and why was it fixed

Change the index hint limit to use Short.MAX_VALUE

@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

The coordinator will always validate that the indexes mentioned by the index hints exist in the schema, and there cannot be repeated index in the hints because the hints are disjoint sets. So the number of index hints is implicitly limited by the number of existing indexes. I don't see why we should check a guardrail to limit the number of hints.

Maybe a reason could be that the guardrail has changed to a value lower than the number of existing indexes? But even in that case it's odd to use the guardrail for SAI when the hints could contain other indexes. I think if we want to use a guardrail we could instead count the number of hints referencing an index of each kind and apply the relevant guardrail.

@driftx
Copy link
Author

driftx commented Dec 12, 2025

Updated to bring this in line with main, checking Short.MAX_VALUE and no guardrails.

@driftx driftx changed the title CNDB-16289: switch index hints limit to use SAI guardrail CNDB-16289: switch index hints limit to use Short.MAX_VALUE Dec 12, 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.

LGTM, +1.

@sonarqubecloud
Copy link

@cassci-bot
Copy link

@driftx driftx merged commit 14cef0c into main-5.0 Dec 12, 2025
579 of 594 checks passed
@driftx driftx deleted the CNDB-16289 branch December 12, 2025 18:07
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.

5 participants