Add durable route catalog delta watch#1117
Conversation
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 (18e0a1d):
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. |
|
Warning Review limit reached
Next review available in: 40 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 (1)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughカタログ変更を永続デルタとして保存・取得し、Engineへ段階適用する機能を追加した。Distributionサーバーは能力取得とストリーミング監視を提供し、gRPCウォッチャーは再接続、リセット、旧RPCへのフォールバックに対応する。 Changesカタログデルタの契約と永続化
Engineとローカル同期
Distributionサーバー
gRPC統合
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Runtime
participant GRPCCatalogWatcher
participant DistributionServer
participant CatalogStore
participant Engine
Runtime->>GRPCCatalogWatcher: リーダー接続を解決
GRPCCatalogWatcher->>DistributionServer: GetCatalogCapabilities
GRPCCatalogWatcher->>DistributionServer: WatchCatalog
DistributionServer->>CatalogStore: ChangesSince
CatalogStore-->>DistributionServer: ResetまたはDeltas
DistributionServer-->>GRPCCatalogWatcher: CatalogWatchEvent
GRPCCatalogWatcher->>Engine: ApplySnapshotまたはApplyDelta
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Code Review
This pull request introduces a versioned route catalog delta and streaming watch protocol to optimize route propagation. It adds a durable delta log, supports atomic delta publication in the route engine, and implements new gRPC endpoints (GetCatalogCapabilities and WatchCatalog) along with a client-side GRPCCatalogWatcher. A potential issue was identified in the watcher's fallback mechanism: when the watch stream is unimplemented, the watcher successfully falls back to snapshot synchronization but still returns an Unimplemented error, which could flood logs with warnings and trigger unnecessary reconnect loops.
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.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@distribution/catalog_delta.go`:
- Around line 237-241: DELETE payload validation must reject route information
in both input paths: update the CatalogMutationDelete handling in
distribution/catalog_delta.go (lines 237-241) to reject any non-zero
RouteDescriptor, and update the DELETE protobuf handling in
distribution/grpc_watcher.go (lines 281-289) to reject events when route is set.
In `@distribution/grpc_watcher.go`:
- Around line 120-127: Update the fallback flow around consumeStream and
syncSnapshot so that when the watch returns codes.Unimplemented and snapshot
synchronization succeeds, the method returns nil instead of the original err;
continue returning the joined error when syncSnapshot fails and preserve direct
returns for other watch errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6484f689-e498-46aa-a4bb-7e69a49f14d6
⛔ Files ignored due to path filters (2)
proto/distribution.pb.gois excluded by!**/*.pb.goproto/distribution_grpc.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (12)
adapter/distribution_milestone1_e2e_test.goadapter/distribution_server.goadapter/distribution_server_delta_test.godistribution/catalog.godistribution/catalog_delta.godistribution/catalog_delta_test.godistribution/engine.godistribution/grpc_watcher.godistribution/watcher.godocs/design/2026_07_18_implemented_route_catalog_delta_watch.mdmain.goproto/distribution.proto
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 (2e86ebc):
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. |
|
Current HEAD: Resolved the current-head findings:
Caller audit:
Verification:
All pass locally. The two new merge commits are signed by @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e86ebc761
ℹ️ 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 (2622b96):
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. |
|
Current HEAD: Resolved the current split-delta timestamp finding. Caller audit: Verification:
All pass locally. Commit is signed by @codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
Summary
Safety and compatibility
Verification
go test ./distribution -count=1go test -race ./distribution ./adapterwith focused route-catalog coveragego test . -run '^$' -count=1golangci-lint run ./distribution ./adapter . --timeout=5mmake -C proto gengit diff --checkSummary by CodeRabbit
新機能
改善
ドキュメント