tidb icon indicating copy to clipboard operation
tidb copied to clipboard

br: mod blockfile to allow larger restore time range for repeat pitr

Open RidRisR opened this issue 2 months ago • 9 comments

What problem does this PR solve?

Issue Number: close #64588

Problem Summary:

Original behaviour:
The system performs a full backup at midnight (T0).
At 20:00(T3), the customer requests to restore the data to 18:00 (T2).
→ The restore runs normally and completes successfully.
After checking the data, the customer realizes something is still wrong and asks to restore it again, this time to 17:00 (T1).
→ This second restore fails, even though the first restore finished cleanly (no abort, no interruption).
expect behaviour:
Allow the second pitr to up to T3, which is actually safe because the restored tables are not created.

What changed and how does it work?

Check List

Tests

  • [x] Unit test
  • [x] 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.

We have modified the blockfile validation system. We used to prevent any restore that overlap with existing pitr, now the restrict is loosen.

RidRisR avatar Nov 13 '25 09:11 RidRisR

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

ti-chi-bot[bot] avatar Nov 13 '25 09:11 ti-chi-bot[bot]

Hi @RidRisR. 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.

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.

tiprow[bot] avatar Nov 13 '25 09:11 tiprow[bot]

Codecov Report

:x: Patch coverage is 79.41176% with 14 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 70.7475%. Comparing base (5271f75) to head (cfa9ced). :warning: Report is 10 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #64465        +/-   ##
================================================
- Coverage   70.9053%   70.7475%   -0.1578%     
================================================
  Files          1888       1867        -21     
  Lines        515654     511488      -4166     
================================================
- Hits         365626     361865      -3761     
- Misses       125622     126520       +898     
+ Partials      24406      23103      -1303     
Flag Coverage Δ
integration 45.7967% <79.4117%> (-2.3598%) :arrow_down:
unit 66.4628% <30.8823%> (+0.8225%) :arrow_up:

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

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 59.8070% <79.4117%> (+0.4117%) :arrow_up:
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 19 '25 07:11 codecov[bot]

/ok-to-test

Leavrth avatar Dec 03 '25 08:12 Leavrth

[LGTM Timeline notifier]

Timeline:

  • 2025-12-03 07:49:26.242902408 +0000 UTC m=+422511.056679970: :ballot_box_with_check: agreed by Leavrth.
  • 2025-12-04 03:57:32.511480185 +0000 UTC m=+494997.325257747: :ballot_box_with_check: agreed by YuJuncen.

ti-chi-bot[bot] avatar Dec 04 '25 03:12 ti-chi-bot[bot]

/approve

Leavrth avatar Dec 05 '25 06:12 Leavrth

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Leavrth, YuJuncen

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

The pull request process is described here

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[bot] avatar Dec 05 '25 06:12 ti-chi-bot[bot]

/hold

Leavrth avatar Dec 05 '25 07:12 Leavrth

/retest

BornChanger avatar Dec 09 '25 21:12 BornChanger

/retest

BornChanger avatar Dec 12 '25 07:12 BornChanger

/unhold

Leavrth avatar Dec 12 '25 09:12 Leavrth

/retest

Leavrth avatar Dec 12 '25 11:12 Leavrth

/retest

Leavrth avatar Dec 12 '25 13:12 Leavrth

/retest

purelind avatar Dec 12 '25 20:12 purelind

/retest

Leavrth avatar Dec 13 '25 04:12 Leavrth

/retest

Leavrth avatar Dec 13 '25 10:12 Leavrth

In response to a cherrypick label: new pull request created to branch release-8.5: #65018. But this PR has conflicts, please resolve them!

ti-chi-bot avatar Dec 13 '25 10:12 ti-chi-bot