Skip to content

dm/syncer: advance checkpoint on rotate events (#12405)#12525

Merged
ti-chi-bot[bot] merged 5 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-12405-to-release-8.5
Mar 7, 2026
Merged

dm/syncer: advance checkpoint on rotate events (#12405)#12525
ti-chi-bot[bot] merged 5 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-12405-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #12405

What problem does this PR solve?

Issue Number: close #12339

What is changed and how it works?

Advance global checkpoint position based on end location of rotate events.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Questions

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

Release note

Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.

@ti-chi-bot ti-chi-bot added area/dm Issues or PRs related to DM. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 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 Feb 13, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @ti-chi-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the global checkpoint was not being consistently updated during binlog rotate events. By explicitly saving the global checkpoint position when a non-fake rotate event occurs, the change ensures more accurate and reliable progress tracking, which is crucial for data consistency and disaster recovery scenarios. The addition of a dedicated unit test further validates this critical behavior.

Highlights

  • Global Checkpoint Advancement: The system now correctly advances the global checkpoint position based on the end location of non-fake rotate events, ensuring that the checkpoint accurately reflects the processed binlog position.
  • Unit Test Coverage: A new unit test has been added to specifically verify that the global checkpoint is updated as expected when a rotate event is handled, improving the robustness of the checkpointing mechanism.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • dm/syncer/syncer.go
    • Modified handleRotateEvent to save the global checkpoint using s.saveGlobalPoint(ec.endLocation) when processing non-fake rotate events.
  • dm/syncer/syncer_test.go
    • Added TestHandleRotateEventUpdatesGlobalCheckpoint to test the correct advancement of the global checkpoint during rotate events.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request correctly implements the advancement of the global checkpoint position when a rotate event is received. This is a valuable improvement that ensures the syncer's progress is tracked even during periods of inactivity in the binlog stream (e.g., when rotating through empty or filtered binlog files). The implementation correctly handles both normal and sharding resync modes and appropriately skips fake rotate events. A unit test has been added to verify the core functionality.

Comment on lines +2561 to +2563
if !utils.IsFakeRotateEvent(ec.header) {
s.saveGlobalPoint(ec.endLocation)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic to save the global point on a non-fake rotate event is duplicated here and at the end of the function. While correct, it could be refactored for better maintainability. However, since this is a cherry-pick and the logic is sound, this is a minor observation.

@ti-chi-bot ti-chi-bot bot added the approved label Feb 13, 2026
@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-8.5@f18090a). Learn more about missing BASE report.

Additional details and impacted files
Components Coverage Δ
cdc 57.8263% <0.0000%> (?)
dm 48.7081% <0.0000%> (?)
engine 50.7332% <0.0000%> (?)
Flag Coverage Δ
unit 53.4431% <50.0000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             release-8.5     #12525   +/-   ##
================================================
  Coverage               ?   53.4431%           
================================================
  Files                  ?       1045           
  Lines                  ?     137142           
  Branches               ?          0           
================================================
  Hits                   ?      73293           
  Misses                 ?      58394           
  Partials               ?       5455           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@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 Feb 14, 2026
@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

3 similar comments
@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Mar 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3AceShowHand, Benjamin2037, D3Hunter

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:
  • OWNERS [3AceShowHand,Benjamin2037,D3Hunter]
  • dm/OWNERS [Benjamin2037,D3Hunter]

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

@3AceShowHand
Copy link
Copy Markdown
Contributor

/retest

1 similar comment
@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

4 similar comments
@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@3AceShowHand
Copy link
Copy Markdown
Contributor

/test all

joechenrh added a commit to joechenrh/tiflow that referenced this pull request Mar 6, 2026
… algorithm (pingcap#12525)

Add a new `checksum-algorithm` configuration flag to sync-diff-inspector
to support FIPS-compliant environments where MD5 is disabled. Supported
options: "md5" (default) and "sha256".

Cherry-picked from pingcap/tidb-tools#886
Close pingcap/tidb-tools#885

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@OliverS929
Copy link
Copy Markdown
Contributor

/retest

4 similar comments
@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@OliverS929
Copy link
Copy Markdown
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit aa5c32c into pingcap:release-8.5 Mar 7, 2026
25 of 29 checks passed
@ti-chi-bot ti-chi-bot bot deleted the cherry-pick-12405-to-release-8.5 branch March 7, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved area/dm Issues or PRs related to DM. 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/M Denotes a PR that changes 30-99 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.

5 participants