Skip to content

sql,kv: the builtin list_sql_keys_in_range emits requests outside of the tenant keyspace #95006

@knz

Description

@knz

Describe the problem

The builtin function crdb_internal.list_sql_keys_in_range() currently errors out in secondary tenans

ERROR: RangeIterator failed to seek to /Meta2/"\x00": rpc error: code = Unauthenticated desc = requested key /Meta2/"\x00" not fully contained in tenant keyspace /Tenant/1{2-3}

Expected behavior

  • for ranges that contain the requesting tenant's data, the builtin should work and return results without errors.
  • for ranges that don't contain the requesting tenant's data, we should have a check:
    • if the tenant is the system tenant, allow the request to go through
    • otherwise return a clear error

Jira issue: CRDB-23269

Epic CRDB-23344

Metadata

Metadata

Assignees

Labels

A-kv-observabilityA-multitenancyRelated to multi-tenancyA-sql-builtinsSQL built-in functions and semantics thereof.C-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