server: fence capture writes with etcd and P2P leases (#6092) - #6172
ti-chi-bot wants to merge 1 commit into
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
@asddongmen This PR has conflicts, I have hold it. |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. 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 ti-community-infra/tichi repository. |
|
[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 |
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (81)
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 |
This is an automated cherry-pick of #6092
What problem does this PR solve?
Issue Number: close #6045
A network-isolated capture may write after replacement dispatchers start. This overlap can leave a MySQL sink inconsistent after checkpoint advancement.
What is changed and how it works?
Gate capture writes with etcd and coordinator P2P proofs, negotiated through node heartbeats and a remote witness. Enforce admission in transport workers and before DML is sent to downstream. Confirmed session loss exits the capture. Add metrics, deterministic tests, and a 10-second removal grace.
Already-admitted transactions remain outside the guarantee because an accepted COMMIT cannot be revoked.
End-to-end validation
A three-capture/MySQL test-infra gate sustained 20.3k DML/s, exercised lifecycle/network faults, matched ten table CRCs, and found no panic.
cdc_network_lossA six-round soak is running: 12 chaos hours, about 360 faults, and up to 972 million DMLs.
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
The check is in memory; 500 ms heartbeats and capability negotiation preserve rolling upgrades.
Do you need to update user documentation, design documentation or monitoring documentation?
No user documentation change; metrics expose write-lease state.
Release note
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Documentation