Skip to content
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

restore: make incremental restore and log restore compatible #54473

Merged
merged 12 commits into from
Jul 10, 2024

Conversation

3pointer
Copy link
Contributor

@3pointer 3pointer commented Jul 5, 2024

What problem does this PR solve?

Issue Number: ref #54474

Problem Summary:

  1. current incremental backup is not compatible with log backup in one restore command. this pr try to make them compatible.

What changed and how does it work?

  1. skip cluster empty check when restore incremental + log backup.
  2. provide an option for restore command to skip rewrite timestamp with a limitation ddl support.(NOTICE: this option will make incremental restore do a strict check for ddls by default)

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
    In order to protect data not loss for later log restore, the new add option during incremental restore will perform a strict check for ddls by default. which means the restore could fail due to unsupported backfill ddl types appeared. such as Add Index/Modify Column/Reorg Partition.
    Documentation https://github.com/pingcap/docs-cn/pull/17893/files

  • 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.

Fix the issue that allow log restore perform based on an incremental restore.

Copy link

ti-chi-bot bot commented Jul 5, 2024

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 ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 5, 2024
Copy link

tiprow bot commented Jul 5, 2024

Hi @3pointer. 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.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 5, 2024
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

lgtm for ddl part

@3pointer 3pointer marked this pull request as ready for review July 8, 2024 02:25
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2024
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 53.33333% with 28 lines in your changes missing coverage. Please review.

Project coverage is 56.8557%. Comparing base (08147e7) to head (7942cd7).
Report is 28 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54473         +/-   ##
=================================================
- Coverage   72.8476%   56.8557%   -15.9920%     
=================================================
  Files          1542       1670        +128     
  Lines        436136     614701     +178565     
=================================================
+ Hits         317715     349493      +31778     
- Misses        98837     241325     +142488     
- Partials      19584      23883       +4299     
Flag Coverage Δ
integration 38.2798% <53.3333%> (?)
unit 71.8694% <10.0000%> (+0.0015%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 62.7210% <55.1724%> (+16.8368%) ⬆️

br/pkg/task/restore.go Outdated Show resolved Hide resolved
@@ -237,6 +239,10 @@ type RestoreConfig struct {
// if it is empty, directly take restoring log justly.
FullBackupStorage string `json:"full-backup-storage" toml:"full-backup-storage"`

// LogIncrementalCompat indicates whether this restore should enter a compatibility mode for incremental restore.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// LogIncrementalCompat indicates whether this restore should enter a compatibility mode for incremental restore.
// AllowPITRFromIncremental indicates whether this restore should enter a compatibility mode for incremental restore.

br/pkg/task/restore.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2024
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2024
@3pointer
Copy link
Contributor Author

3pointer commented Jul 8, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented Jul 8, 2024

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

In response to this:

/test pull-br-integration-test

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.

@3pointer 3pointer changed the title Make incremental restore and log restore compatible restore: make incremental restore and log restore compatible Jul 9, 2024
Copy link

ti-chi-bot bot commented Jul 9, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-05 09:54:55.62209269 +0000 UTC m=+5792.857326788: ☑️ agreed by tangenta.
  • 2024-07-09 06:04:22.1897741 +0000 UTC m=+337559.425008213: ☑️ agreed by Leavrth.

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 9, 2024
@3pointer
Copy link
Contributor Author

3pointer commented Jul 9, 2024

/hold for test passed

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2024
@3pointer
Copy link
Contributor Author

/test check-dev2

Copy link

tiprow bot commented Jul 10, 2024

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

In response to this:

/test check-dev2

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.

@3pointer
Copy link
Contributor Author

/test check-dev2

Copy link

tiprow bot commented Jul 10, 2024

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

In response to this:

/test check-dev2

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

ti-chi-bot bot commented Jul 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BornChanger, Leavrth, tangenta, 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

@3pointer
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 10, 2024
@3pointer
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Jul 10, 2024

@3pointer: 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.

@BornChanger
Copy link
Contributor

/retest

Copy link

tiprow bot commented Jul 10, 2024

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

@ti-chi-bot ti-chi-bot bot merged commit 749d303 into pingcap:master Jul 10, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants