Repository navigation
coordinator: persist maintainer epochs before ownership changes (#5434) - #5788
ti-chi-bot[bot] merged 5 commits into
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
@hongyunyan 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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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. Comment |
|
Cherry-pick conflicts appear resolved; removing the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongyunyan, lidezhu 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 |
This is an automated cherry-pick of #5434
What problem does this PR solve?
Issue Number: ref #5083
This is PR 1 of 3 split from #5182.
Background:
During maintainer failover, the coordinator can schedule a new maintainer while
delayed requests from the previous maintainer are still in flight. Receiver-side
fencing only works if every new ownership attempt has a persisted, monotonic
maintainer epoch before any add or move request is sent.
Motivation:
The old code generated owner epochs from in-memory state and resumed changefeeds
with a normal metadata write. That made it hard to prove that a new maintainer
owner is always ordered after the previously persisted owner, especially across
coordinator failover, resume, retry, and move paths.
What is changed and how it works?
This PR adds the coordinator-side epoch persistence foundation:
heartbeat, and close messages.
BumpChangefeedEpochto atomically persist a strictly newer changefeedepoch, optionally with status updates under the same etcd transaction.
retry scheduling can create a new maintainer owner.
ChangeFeedInfo.reported owners with their original epoch.
fenced by the epoch they actually own.
Stack:
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
No expected performance regression. Epoch bumps happen on ownership-changing
control paths such as add, move, resume, and retry scheduling, not in the event
write path.
The protobuf fields are optional. Epoch 0 remains the compatibility value used
by old components until later PRs enforce strict receiver-side fences.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note
Validation
make generate-protobufmake fmtgo test ./coordinator/changefeed ./coordinator ./coordinator/operator ./pkg/pdutilSummary by CodeRabbit