distribution: add split HLC route codec#1066
Conversation
|
Warning Review limit reached
Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (15)
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 |
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (4e3bff7):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
Ready for review. This implements the hotspot split catalog codec slice:
Validation:
|
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new SplitAtHLC field to the RouteDescriptor struct, upgrading the route codec version to V2. It updates the encoding, decoding, cloning, and equality logic to support this new field while maintaining backward compatibility with V1 route descriptors. Feedback was provided to optimize the decoding of SplitAtHLC by using binary.BigEndian.Uint64 instead of binary.Read to avoid reflection and heap allocations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review 対応しました。
検証:
|
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (9856a5c):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9856a5cc28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (14962c3):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review 対応しました。
検証:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14962c3641
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (eea7ea0):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review 対応しました。
検証:
補足: go test ./adapter ./kv ./distribution -count=1 -timeout=240s は adapter package 全体が timeout しました。今回変更対象の targeted tests / compile / lint は通過しています。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eea7ea0353
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| CatalogVersion: saved.Version, | ||
| Left: toProtoRouteDescriptor(left), | ||
| Right: toProtoRouteDescriptor(right), | ||
| Left: toProtoRouteDescriptor(savedLeft), |
There was a problem hiding this comment.
Include SplitAtHLC in route descriptors
When SplitRange is called through the Distribution API, savedLeft now contains the leader-stamped SplitAtHLC, but toProtoRouteDescriptor/pb.RouteDescriptor still omit that field, so the response serializes the same descriptor shape as before. Any caller that relies on the SplitRange/ListRoutes RPC output to seed or reconstruct split cooldowns will see no durable split timestamp and can treat just-created children as not cooling down; add a split_at_hlc field to distribution.proto and populate it here.
Useful? React with 👍 / 👎.
| if err := s.applyEngineSnapshot(saved); err != nil { | ||
| return nil, err | ||
| } | ||
| savedLeft, savedRight, err := splitChildrenFromSnapshot(saved, left.RouteID, right.RouteID) |
There was a problem hiding this comment.
Reload the exact split version
Because saveSplitResultViaCoordinator reloads any snapshot with Version >= nextVersion, a concurrent SplitRange on another node can advance the catalog again before this line runs. If that follow-up split targets one of these just-created children, the newer snapshot no longer contains left.RouteID or right.RouteID, so splitChildrenFromSnapshot returns an Internal error even though this split already committed successfully; load the snapshot at this transaction's commit timestamp/exact catalog version before extracting the response descriptors.
Useful? React with 👍 / 👎.
| // preserving SSI. | ||
| return c.dispatchSingleShardTxn(ctx, startTS, commitTS, prevCommitTS, primaryKey, gids[0], elems, readKeys, observedRouteVersion) | ||
| } | ||
| if err := StampGroupedMutationCommitTS(grouped, commitTS); err != nil { |
There was a problem hiding this comment.
Clear patch offsets before forwarding PREPARE
For a multi-shard transaction with a CommitTSValueOffset, this stamps the grouped mutations but leaves CommitTsValueOffset set on the PREPARE payloads. When one of those shard commits goes through a LeaderProxy, forward() sends the PREPARE to Internal.Forward, whose txn stamping sees no commit meta for PREPARE and then calls StampMutationCommitTS with commitTS == 0, causing an ErrTxnCommitTSRequired rejection even though the value was already patched; clear the offset after stamping or skip commit-TS patching for PREPARE forwarding.
Useful? React with 👍 / 👎.
|
@codex review 対応しました。
検証:
補足: go test ./adapter ./distribution ./kv ./proto -count=1 -timeout=600s は adapter package の統合テスト群で 600s timeout しました。今回変更対象の focused tests、distribution/kv/proto package tests、全体 compile、lint は通過しています。 |
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (d0a7c4c):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
To use Codex here, create a Codex account and connect to github. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Author: bootjp
Summary
Validation