When a tenant is created, its last range's endkey is Max instead of the startKey of the next tenant. This is automatically corrected by the reconciler later on (see https://github.com/cockroachdb/cockroach/pull/95100/files#diff-58b36925f72a8a1d1f9b496bdd458b2edd6846835ba6fb1717b1e7abc1d0e9e9R19).
As a temporary workaround TestTenant.WaitForTenantEndKeySplit was added as part of #95100 for tests (e.g. sql_keys logic test) that need the "correct" tenant range endKey (the next tenant's startKey instead of Max).
It would be better to handle this by making sure the tenant's last range's endKey is the tenant keyspace's endKey during tenant creation.
Jira issue: CRDB-25003
Epic: CRDB-23559
When a tenant is created, its last range's endkey is Max instead of the startKey of the next tenant. This is automatically corrected by the reconciler later on (see https://github.com/cockroachdb/cockroach/pull/95100/files#diff-58b36925f72a8a1d1f9b496bdd458b2edd6846835ba6fb1717b1e7abc1d0e9e9R19).
As a temporary workaround
TestTenant.WaitForTenantEndKeySplitwas added as part of #95100 for tests (e.g.sql_keyslogic test) that need the "correct" tenant range endKey (the next tenant's startKey instead of Max).It would be better to handle this by making sure the tenant's last range's endKey is the tenant keyspace's endKey during tenant creation.
Jira issue: CRDB-25003
Epic: CRDB-23559