Skip to content

dispatcher: rebuild closed managers during maintainer failover (#6674) - #6715

Open
ti-chi-bot wants to merge 2 commits into
pingcap:release-nextgen-202609from
ti-chi-bot:cherry-pick-6674-to-release-nextgen-202609
Open

ti-chi-bot wants to merge 2 commits into
pingcap:release-nextgen-202609from
ti-chi-bot:cherry-pick-6674-to-release-nextgen-202609

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #6674

What problem does this PR solve?

Issue Number: close #6519

What is changed and how it works?

  • Detect closing or closed DispatcherManagers before reusing them during bootstrap. Keep bootstrap pending until cleanup completes, then remove the old manager and create a new one through the existing initialization path.
  • Record the closing maintainer epoch when a close request is accepted, preserving stale-bootstrap fencing and epoch-0 removal tombstones.
  • Add regression coverage for healthy-manager handover, closing/closed-manager recovery, stale epochs, and epoch-0 compatibility and removal.

Check List

Tests

  • Unit test

Passed locally:

go test -race -tags=intest ./downstreamadapter/dispatcherorchestrator \
  -run '^TestHandleBootstrapRequest(CanCreateDispatcherAfterHandover|RejectsStaleEpochAfterManagerClose)$' -count=10

go test -race -tags=intest ./downstreamadapter/dispatchermanager ./downstreamadapter/dispatcherorchestrator -count=1

Kafka integration tests were not run.

Questions

Will it cause performance regression or break compatibility?

No performance regression or compatibility break is expected. Changes are limited to bootstrap and close handling. Healthy-manager handover, existing epoch fencing, and epoch-0 compatibility are preserved. No configuration or protocol changes are introduced.

Do you need to update user documentation, design documentation or monitoring documentation?

No documentation updates are needed.

Release note

Fix a changefeed checkpoint stall caused by reusing a closing or closed dispatcher manager after maintainer failover.

@ti-chi-bot ti-chi-bot added lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202609 labels Oct 26, 2026
@ti-chi-bot

ti-chi-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be LGTMed and approved by the reviewers firstly.
  2. For pull requests to TiDB-x branches, it must have no failed tests.
  3. AFTER it has lgtm and approved labels, please wait for the cherry-pick merging approval from triage owners.
Details

Instructions 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.

@ti-chi-bot

ti-chi-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kennytm for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b978596a-a1f2-419a-8fd4-6dbf07f27833
Commits

Reviewing files that changed from the base of the PR and between 6a57644 and 54bf027.

Files selected for processing: 4
  • downstreamadapter/dispatchermanager/dispatcher_manager.go
  • downstreamadapter/dispatchermanager/dispatcher_manager_test.go
  • downstreamadapter/dispatcherorchestrator/dispatcher_orchestrator.go
  • downstreamadapter/dispatcherorchestrator/dispatcher_orchestrator_test.go
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/cherry-pick-not-approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202609

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants