Repository navigation
fix: include namespace in API V3 physical routing - #567
Conversation
Signed-off-by: disksing <i@disksing.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
API V3 keyspaces with the same local ID in different namespaces currently produce identical physical routing keys. Encode the routing prefix as mode + 32-bit namespace + 24-bit keyspace, including carry across the complete prefix for exclusive range bounds. RPC keys remain logical, and API V2 routing is unchanged.
Add
TransactionClient::with_keyspace_identityto derive scoped clients while sharing the PD connection and region cache. Bound the shared V3 timestamp-oracle cache to 64 least-recently-used entries. In-flight requests retain their oracle until the response completes; evicted streams terminate when their final owner is released. Pending queues allocate on demand.Restore compatibility with legacy PD metadata that omits the proto3 scalar keyspace ID zero, while continuing to distinguish explicit V3 identities. This fixes the existing DEFAULT-keyspace failure in the raw and transaction integration jobs against PD v8.5.5.
Validation: 143 client unit tests, including legacy wire decoding and oracle eviction/in-flight lifetime cases; Rust 1.93 format and all-target clippy with warnings denied; CSE integration using namespaces 7 and 19 with the same keyspace ID, covering bidirectional transactions, alternating cached reads, unbounded forward/reverse scans, pessimistic locks, and independent expired-lock resolution. The preceding legacy-compatibility commit also passed both GitHub integration jobs; CI is rerunning for the final oracle-lifetime change.
These protocol changes require coordinated PD/CSE/client rollout to a newly initialized V3 cluster; existing four-byte V3 data is not migrated by this PR.