Skip to content

br: compatibility of log backup and log restore #61238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Leavrth
Copy link
Contributor

@Leavrth Leavrth commented May 21, 2025

What problem does this PR solve?

Issue Number: close #61237

Problem Summary:
compatibility of log backup and log restore

What changed and how does it work?

PITR can restore on the cluster running log backup, and these restored tables can not be restored until there is a full backup later.

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

Leavrth added 2 commits May 21, 2025 16:50
Signed-off-by: Jianjun Liao <[email protected]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels May 21, 2025
Copy link

tiprow bot commented May 21, 2025

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

Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 63.78378% with 67 lines in your changes missing coverage. Please review.

Project coverage is 74.8684%. Comparing base (e3478a5) to head (f25e044).
Report is 18 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #61238        +/-   ##
================================================
+ Coverage   73.1657%   74.8684%   +1.7026%     
================================================
  Files          1725       1726         +1     
  Lines        477926     482337      +4411     
================================================
+ Hits         349678     361118     +11440     
+ Misses       106834      98996      -7838     
- Partials      21414      22223       +809     
Flag Coverage Δ
integration 45.9862% <49.7297%> (?)

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

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 61.9994% <63.7837%> (+14.4378%) ⬆️
🚀 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.

@BornChanger
Copy link
Contributor

/retest

Copy link

tiprow bot commented May 21, 2025

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

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.

restoreErr = err
return
}
tableIds := make([]int64, 0, len(cfg.PiTRTableTracker.TableIdToDBIds))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think PiTRtableTracker might be nil if this is not a pitr restore, does the check logTaskBackend == nil guarantee this is a PiTR?

Signed-off-by: Jianjun Liao <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 22, 2025
Copy link
Contributor

@3pointer 3pointer left a comment

Choose a reason for hiding this comment

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

rest LGTM

Comment on lines +160 to +165
if parsed {
if filterOutFn(restoreCommitTs, snapshotBackupTs) {
return nil
}
}
filenames = append(filenames, path)
Copy link
Contributor

Choose a reason for hiding this comment

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

if not parsed, why still need append this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm worried that some external storage make the filename dirty.

if err != nil {
return errors.Trace(err)
}
if filterOutFn(restoreCommitTs, snapshotBackupTs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems a little bit duplicated?

return errors.Errorf(
"cannot restore the table(Id=%d) because it is restored(at %d) before snapshot backup(at %d). "+
"Please respecify the filter that does not contain the table or replace with a newer snapshot backup.",
tableId, restoreCommitTs, startTs)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to record more table info(like table name), do we have chance to make this log more easy to debug?

return
}
tableIds := make([]int64, 0, len(cfg.PiTRTableTracker.TableIdToDBIds))
for tableId := range cfg.PiTRTableTracker.TableIdToDBIds {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we handle PartitionIds here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to handle the exchange partition ddl. Maybe it is now a partition in this PITR restore.

Copy link

ti-chi-bot bot commented May 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer

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

ti-chi-bot bot commented May 22, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-22 06:44:30.051607501 +0000 UTC m=+74774.468667059: ☑️ agreed by 3pointer.

Leavrth added 4 commits May 22, 2025 15:30
Signed-off-by: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
Signed-off-by: Jianjun Liao <[email protected]>
Copy link

ti-chi-bot bot commented May 22, 2025

@Leavrth: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/unit-test f25e044 link true /test unit-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compatibility of log backup and log restore
4 participants