server: shorten capture removal delay on rolling restart - #6212
asddongmen wants to merge 4 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds write-lease state to capture metadata, publishes a lease-checked stopped marker during clean shutdown, and updates reactor removal scheduling. Matching same-address current-protocol replacements use a five-second delay; other cases use the conservative removal TTL. The move-table integration test also adds CDC server restart guards. ChangesCapture write-lease removal
Move-table integration test guards
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant CaptureServer
participant Etcd
participant GlobalReactorState
participant ReplacementCapture
CaptureServer->>Etcd: publish lease-bound write-stopped metadata
Etcd-->>GlobalReactorState: report capture-key deletion
GlobalReactorState->>GlobalReactorState: remove stopped capture immediately
ReplacementCapture->>GlobalReactorState: register same-address current-protocol capture
GlobalReactorState->>GlobalReactorState: apply five-second fenced delay
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change appears ready to merge after normal checks. No actionable failure was established in the shortened removal paths or the updated integration test. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. A rabbit watched the leases glow, Comment |
|
/test all |
[LGTM Timeline notifier]Timeline:
|
|
/check-issue-triage-complete |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3AceShowHand, nongfushanquan, wk989898 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test pull-cdc-mysql-integration-light-next-gen |
|
/test pull-cdc-mysql-integration-light-next-gen |
1 similar comment
|
/test pull-cdc-mysql-integration-light-next-gen |
|
/test pull-cdc-mysql-integration-heavy-next-gen |
|
/test all |
|
/test all |
|
@asddongmen: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #6203
During a rolling restart, a capture whose etcd key has been deleted remains in the scheduler-visible node view for the full
captureRemoveTTL(10 seconds by default). This can keep a new coordinator waiting for a bootstrap response from an exited capture after every live capture has responded. Removing the node immediately is unsafe while the old capture may still hold a valid write proof.What is changed and how it works?
write-stoppedmarker before deleting the capture key. Observers remove a marked capture immediately.captureRemoveTTLfor legacy, capability-unknown, mismatched, or failed-shutdown cases.Check List
Tests
go test ./pkg/orchestrator ./server -count=1go test ./pkg/config ./pkg/metrics -count=1go test -racefor the new pathsmake fmtmake cdcQuestions
Will it cause performance regression or break compatibility?
No expected regression. Address matching scans membership only on capture events. The metadata fields are additive; legacy or unknown nodes retain the existing 10-second fallback.
Do you need to update user documentation, design documentation or monitoring documentation?
Yes. The capture write-lease design and overview, plus the delay metric description, are updated.
Release note
Summary by CodeRabbit
New Features
Bug Fixes
Documentation