Skip to content

ddl: enhance checkpoint management with chunk tracking#64607

Merged
ti-chi-bot[bot] merged 2 commits into
pingcap:masterfrom
GMHDBJD:fixFlakyCheckpoint
Dec 2, 2025
Merged

ddl: enhance checkpoint management with chunk tracking#64607
ti-chi-bot[bot] merged 2 commits into
pingcap:masterfrom
GMHDBJD:fixFlakyCheckpoint

Conversation

@GMHDBJD
Copy link
Copy Markdown
Collaborator

@GMHDBJD GMHDBJD commented Nov 20, 2025

What problem does this PR solve?

Issue Number: close #64602

Problem Summary:

What changed and how does it work?

  • add chunksTotal and chunksFinished to record checkpoint, avoid panic

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 20, 2025
@tiprow
Copy link
Copy Markdown

tiprow Bot commented Nov 20, 2025

Hi @GMHDBJD. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

@GMHDBJD
Copy link
Copy Markdown
Collaborator Author

GMHDBJD commented Nov 20, 2025

/retest

@tiprow
Copy link
Copy Markdown

tiprow Bot commented Nov 20, 2025

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.6398%. Comparing base (b6f8c6f) to head (25b35bf).
⚠️ Report is 39 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #64607        +/-   ##
================================================
+ Coverage   74.6509%   75.6398%   +0.9888%     
================================================
  Files          1888       1890         +2     
  Lines        514863     523637      +8774     
================================================
+ Hits         384350     396078     +11728     
+ Misses       106743     103952      -2791     
+ Partials      23770      23607       -163     
Flag Coverage Δ
integration 49.0827% <0.0000%> (+1.0095%) ⬆️
unit 73.2470% <58.3333%> (+0.9176%) ⬆️

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

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 64.4714% <ø> (+2.5488%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GMHDBJD
Copy link
Copy Markdown
Collaborator Author

GMHDBJD commented Nov 25, 2025

/retest

@tiprow
Copy link
Copy Markdown

tiprow Bot commented Nov 25, 2025

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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 added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 2, 2025
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Dec 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, joechenrh

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 2, 2025
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Dec 2, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-02 02:27:45.976940844 +0000 UTC m=+316810.790718406: ☑️ agreed by D3Hunter.
  • 2025-12-02 03:54:32.708140963 +0000 UTC m=+322017.521918535: ☑️ agreed by joechenrh.

}
cp.writtenKeys += delta
cp.chunksFinished++
if cp.chunksFinished == cp.chunksTotal {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It may not be correct after we support OnDuplicateKeyRemove

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

OnDuplicateKeyRemove should not affect chunk count, so this is not a problem

for {
cp := s.checkpoints[s.minTaskIDFinished]
if cp == nil || !cp.lastBatchRead || cp.writtenKeys < cp.totalKeys {
if cp == nil || !cp.lastBatchRead || cp.writtenKeys < cp.totalKeys || cp.chunksFinished < cp.chunksTotal {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IF !(cp.writtenKeys < cp.totalKeys), then chunksFinished must equal to chunksTotal?
So it may always be false here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this case handle the situation when cp.writtenKeys = cp.totalKeys, but cp.chunksFinished < cp.chunksTotal, which will be fixed in #64655

@GMHDBJD
Copy link
Copy Markdown
Collaborator Author

GMHDBJD commented Dec 2, 2025

/retest

@tiprow
Copy link
Copy Markdown

tiprow Bot commented Dec 2, 2025

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

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 merged commit 2b3e951 into pingcap:master Dec 2, 2025
32 checks passed
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 21, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 21, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 21, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 21, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 22, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 22, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 22, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 26, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 26, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 26, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 26, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 26, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 26, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 26, 2026
YangKeao pushed a commit to YangKeao/tidb that referenced this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky test TestAddIndexResumesFromCheckpointAfterPartialImport

4 participants