-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kv: DistSender sends requests outside of the current tenant's keyspace #95003
Copy link
Copy link
Closed
Labels
A-kv-clientRelating to the KV client and the KV interface.Relating to the KV client and the KV interface.A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Description
Describe the problem
Found by @yuzefovich here: #94388 (comment)
when committing the txn we issue EndTxnRequest in which we don't set Key nor EndKey. Then, in DistSender.Send we construct rs which covers all requests in the BatchRequest, and we end up with something like rs = roachpb.RSpan{keys.RKeyMin, keys.RKeyMax}
That span include keys outside of the tenant's keyspace. It violates the requirement that all KV requests emitted by a tenant should be bounded by that tenant's logical keyspace boundaries.
To Reproduce
See the linked issue.
Expected behavior
DistSender should truncate requests to the intersection with the tenant keyspace boundaries.
Jira issue: CRDB-23267
Epic CRDB-23344
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-kv-clientRelating to the KV client and the KV interface.Relating to the KV client and the KV interface.A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)