Skip to content

kv: DistSender sends requests outside of the current tenant's keyspace #95003

@knz

Description

@knz

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

Metadata

Metadata

Assignees

Labels

A-kv-clientRelating to the KV client and the KV interface.A-multitenancyRelated to multi-tenancyC-bugCode 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)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions