CNDB-16886: Reject BM25 queries in validation when the coordinator is…#2459
Merged
Conversation
Checklist before you submit for review
|
a7ace90 to
0651d73
Compare
pkolaczk
approved these changes
Jun 18, 2026
scottfines
pushed a commit
that referenced
this pull request
Jun 19, 2026
… before EC (#2459) Reject BM25 queries on `Index.validate(ReadCommand)` if the current index version doesn't support them. That way they would be rejected on the coordinator before execution, which is faster and produces a descriptive error message, rather than the generic per-replica error codes. The replicas still will do their own validation if the query gets past the coordinator.
djatnieks
pushed a commit
that referenced
this pull request
Jun 23, 2026
… before EC (#2459) Reject BM25 queries on `Index.validate(ReadCommand)` if the current index version doesn't support them. That way they would be rejected on the coordinator before execution, which is faster and produces a descriptive error message, rather than the generic per-replica error codes. The replicas still will do their own validation if the query gets past the coordinator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the issue
Writers reject BM25 queries when the index version if before
Version.BM25_EARLIEST, or when the index doesn't have the needed components. They do that by sendingRequestFailureReason.FEATURE_NEEDS_INDEX_UPGRADE. If the query succeeds in the writers, there are still more version checks in the coordinator, so everything should be in the right version.While that behaviour is correct and manages index version issues in a controlled manner, we could also check the current index version at the query validation step done by the coordinator, before actually executing the query. That would allow us to throw a better error message than the obscure
ReadFailureExceptionwith named error codes, and save us some round trips, in case the coordinator is in the wrong version. TheReadFailureExceptionwith named error codes would still be used for cases when only some of the writers or the sstables is in the wrong version.What does this PR fix and why was it fixed
Reject BM25 queries on
Index.validate(ReadCommand)if the current index version doesn't support them. That way they would be rejected on the coordinator before execution, which is faster and produces a descriptive error message, rather than the generic per-replica error codes. The replicas still will do their own validation if the query gets past the coordinator.