Repository navigation
raft: preserve final commit notifications across peer removal - #1331
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
削除対象の特定とReadyの振り分け internal/raftengine/etcd/removal_notification.go, internal/raftengine/etcd/engine.go, internal/raftengine/etcd/removal_notification_test.go, internal/raftengine/etcd/removal_notification_benchmark_test.go |
コミット済みの ConfChange と ConfChangeV2 から削除対象とエントリー index を抽出します。条件に合う MsgApp を通常の送信経路から分けます。抽出テストと通常エントリーのベンチマークを追加しました。 |
非同期通知の配信と終了処理 internal/raftengine/etcd/removal_notification.go, internal/raftengine/etcd/removal_notification_test.go |
通知ごとに新規 gRPC 接続を作成し、timeout 付きの unary Send でメッセージを送信します。接続置換、dispatcher 停止時のキャンセル、到達不能なピアへの timeout をテストします。 |
削除後の最終コミット通知の検証 internal/raftengine/etcd/removal_notification_test.go, docs/design/2026_10_25_implemented_raft_removal_commit_delivery.md |
ストリーム送信と dispatcher lane の設定を組み合わせ、削除後に最終コミット通知が処理されることを検証します。設計、検証方針、実行結果を文書に記録しました。 |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant Ready as Raft Ready
participant Sender as sendReadyMessages
participant Goroutine as 通知goroutine
participant Peer as 削除対象ノード
Ready->>Sender: Ready内のメッセージ
Sender->>Goroutine: 通知を非同期登録
Goroutine->>Peer: 新規gRPC接続でunary Send
Merge Risk: 
Minimal · up to b28f3
-
No merge-blocking issue is established; the change is ready to merge after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
f0f50ae to
b28f303
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Design: docs/design/2026_10_25_proposed_review_label_permissions.md PR #1331 completed a zero-finding review at HEAD, but the updater failed to add its label with HTTP 403 in run 40112872960. Grant `pull-requests: write` to the default-branch updater so it can add and remove PR labels. Keep `issues: write` for repository label creation. Approval criteria and trusted checkout remain unchanged. Recovered #1331 with the existing reconciler through the authenticated CLI, including HEAD and evidence checks before and after the write. Confirmed `agent-review-approved` at `b28f3030089601c0e47dae053efb2d9263b98457`. This permission change takes effect after merge; live Actions authorization still needs verification then. Validation: all 83 Node tests pass; actionlint passes for all three relevant workflows; git diff --check passes. No Go changes; the Go-only pre-commit lint hook was skipped. Self-review: - Data loss: workflow permissions and documentation only. - Concurrency: serialized reconciliation and HEAD/evidence rechecks preserved. - Performance: no new workflow steps or API calls. - Consistency: approval criteria and default-branch checkout preserved; the privileged job gains PR write scope. - Test coverage: existing regression suite and syntax checks pass; runtime Actions authorization remains a post-merge check. Author: bootjp
Design: docs/design/2026_10_25_implemented_raft_removal_commit_delivery.md
A committed peer removal can cancel the final queued MsgApp before the removed replica receives its commit index. The leader completes RemoveServer, but the removed replica keeps the entry uncommitted, retains its old configuration, and never shuts down. This caused the failure seen in the PR #1319 test job, and also reproduces before the dependency update.
Deliver Raft-generated, commit-covering removal notifications through independent, bounded unary RPC connections. Receiver admission is acknowledged, normal peer teardown stays immediate, and slow delivery cannot block the apply loop. Notification cleanup cannot close a replacement peer's cached connection. Delivery remains best effort during partitions; RemoveServer still reports local committed application.
The receiver-gated regression holds the final notification until local removal has completed, then verifies the removed replica updates its configuration and shuts down. It covers both stream settings and both dispatcher layouts. Additional tests cover V1/V2 changes, malformed entries, cancellation, unreachable targets, and connection replacement.
Validation
Existing checks that do not pass: repository-wide lint reports complexity findings in
kv/fsm.goandkv/shard_store_prepare_evidence_test.go; the unchanged Redis Jepsen submodule's placeholder test imports a nonexistentjepsen.redisnamespace. The pre-commit hook hits the same existing lint findings, so these two commits use a per-command hook override after the targeted lint pass.Review
Summary by CodeRabbit