fix: route tablet-aware batches via routed statement#878
Merged
dkropachev merged 1 commit intoscylladb:scylla-3.xfrom Apr 28, 2026
Merged
Conversation
e1f1d2b to
f268b63
Compare
f268b63 to
2f5b635
Compare
nikagra
reviewed
Apr 27, 2026
|
How does is routing table is used for shard-aware connection borrowing as mentioned in PR description? |
2f5b635 to
0edc894
Compare
0edc894 to
35f8553
Compare
Author
it was left over from first implementation that included fixes for other edge cases of BatchStatement that I had dropped. |
Lorak-mmk
reviewed
Apr 27, 2026
35f8553 to
f621e3f
Compare
f621e3f to
a79cc4e
Compare
Lorak-mmk
approved these changes
Apr 28, 2026
a79cc4e to
c5fedd2
Compare
Batch statements can expose a routing key from one child statement while TokenAwarePolicy derives tablet replica lookup from a different context. For tablet keyspaces, replica lookup also needs the table name that belongs to the same child statement that supplied the routing key. Teach TokenAwarePolicy to resolve routing metadata from the batch child selected for routing, while preserving the existing single-statement BoundStatement and PreparedStatement behavior. Tests cover bound statement tablet lookup, batch tablet lookup through TokenAwarePolicy, and an integration path where learned tablet metadata is used to route a BatchStatement. Fixes scylladb#879
c5fedd2 to
e989b35
Compare
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.
Summary
TokenAwarePolicyderive tablet routing metadata from the same batch child statement that provides the routing keyBoundStatementandPreparedStatementtable-name handlingContext
Batch statements on tablet keyspaces need both a routing key and the table name for tablet replica lookup. The previous implementation could get the routing key from a batch, but table-name extraction only handled direct
BoundStatement/PreparedStatementinputs, so tablet-aware token routing could fall back instead of using tablet metadata.Fixes #879
Fixes: https://scylladb.atlassian.net/browse/CUSTOMER-323
Testing
mvn -pl driver-core -am -Dscylla.version=release:2026.1 -Dccm.version=release:2026.1 -Dccm.scylla=true -Dccm.distribution=scylla -Dtest=TokenAwarePolicyTest#should_use_table_name_from_bound_statement_for_tablet_routing+should_use_table_name_from_routed_statement_in_batch_for_tablet_routing testmvn -pl driver-core -am -Pshort -Dscylla.version=release:2026.1 -Dccm.version=release:2026.1 -Dccm.scylla=true -Dccm.distribution=scylla -Dtest=TabletsIT#batch_statement_should_deliver_tablet_info_and_route_properly test