Skip to content

maintainer: make dispatcher operator admission atomic (#6070) - #6086

Merged
ti-chi-bot[bot] merged 5 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-6070-to-release-8.5
Aug 25, 2026
Merged

maintainer: make dispatcher operator admission atomic (#6070)#6086
ti-chi-bot[bot] merged 5 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-6070-to-release-8.5

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #6070

What problem does this PR solve?

Issue Number: close #6069

What is changed and how it works?

This change prevents multiple operators for the same dispatcher from being admitted concurrently.

Previously, AddOperator checked whether an operator already existed under a read lock, released the lock, and registered the new operator later under a write lock. Two concurrent operations, such as an Add and a Move for the same dispatcher, could both pass the initial check. Both operators would then be started and placed in the running queue, even though one overwrote the other in the operator map. This could create the same dispatcher on different TiCDC nodes.

An empty-origin Move is still allowed. If an Add and an empty-origin Move race for the same dispatcher, atomic admission ensures that only one can win. If the Move wins, it proceeds to create the dispatcher only on its destination node.

The barrier handling path is also hardened to accept a dispatcher’s block status only when the reporting node is the dispatcher’s current owner. Statuses from stale or non-owner dispatcher instances are ignored, preventing them from advancing a DDL or sync-point barrier.

Now the stale merge rollback will no longer mistakenly cancel a later installed remove operator.

Check List

Tests

  • Unit test
  • Integration test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

Fix a race condition that could create duplicate dispatchers and cause downstream data inconsistency.

Summary by CodeRabbit

Bug Fixes

  • Block status updates from non-owner nodes are now safely ignored.
  • Unknown dispatchers and invalid statuses no longer trigger barrier processing.
  • Operator registration now safely rejects concurrent duplicate requests.
  • Replica moves are supported when the original node is unspecified.
  • Operator replacement is now serialized with normal admission, preventing conflicting operations.
  • Stale rollback actions can no longer cancel a newer replacement operator.

Signed-off-by: wk989898 <nhsmwk@gmail.com>
Signed-off-by: wk989898 <nhsmwk@gmail.com>
Signed-off-by: wk989898 <nhsmwk@gmail.com>
Signed-off-by: wk989898 <nhsmwk@gmail.com>
Signed-off-by: wk989898 <nhsmwk@gmail.com>
@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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Aug 25, 2026
@ti-chi-bot ti-chi-bot Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/cherry-pick-not-approved labels Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e55064f-8127-4158-b799-a55b3c51e5dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@ti-chi-bot

ti-chi-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wk989898

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

The pull request process is described 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

@ti-chi-bot ti-chi-bot Bot added the approved label Aug 25, 2026
@wk989898

Copy link
Copy Markdown
Collaborator

/test all

@ti-chi-bot ti-chi-bot Bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Aug 25, 2026
@wk989898

Copy link
Copy Markdown
Collaborator

/retest

@ti-chi-bot
ti-chi-bot Bot merged commit 07713a9 into pingcap:release-8.5 Aug 25, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants