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

br: add table filter for log restore #57394

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

Conversation

Tristan1900
Copy link
Contributor

@Tristan1900 Tristan1900 commented Nov 15, 2024

What problem does this PR solve?

Issue Number: close #57613

Problem Summary:
Need table filter for PiTR

What changed and how does it work?

The following happens if a custom filter is specified during PiTR.

  1. Do a log backup meta scan at first before snapshot restore, and record all the table rename history during the scan
  2. During snapshot restore, adjust the tables that need to be restored according to the rename history. It needs to add tables that renamed into the filter and removes the tables that are renamed out of the filter range during log backup. And put all the tables that need to be restored into a map/filter and pass down to log restore
  3. During log restore, when constructing the id map, we use that map/filter from the above and filter out the tables/kvs that don't need to restore/rewrite, and build the id map based on that. The idmap essentially becomes the same as the filter above.
  4. Using id map to filter out the kvs that doesn't need to restore. For tables not exist in the id map, we can simply ignore it.
  5. The id map is persisted once built to work with checkpoint, so our filter naturally works with checkpoint as well.

TODO: maybe in this same PR. We are scanning 3 times on log backup meta, maybe we can try to reduce to 2

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

Copy link

ti-chi-bot bot commented Nov 15, 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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 15, 2024
Copy link

tiprow bot commented Nov 15, 2024

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

ti-chi-bot bot commented Nov 25, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wjhuang2016, yujuncen for approval, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@Tristan1900 Tristan1900 marked this pull request as ready for review November 25, 2024 00:06
@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 Nov 25, 2024
Signed-off-by: Wenqi Mou <[email protected]>
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 35.86118% with 499 lines in your changes missing coverage. Please review.

Project coverage is 73.6205%. Comparing base (6e22b8c) to head (f624281).
Report is 3 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57394        +/-   ##
================================================
+ Coverage   72.7907%   73.6205%   +0.8298%     
================================================
  Files          1676       1694        +18     
  Lines        463750     464214       +464     
================================================
+ Hits         337567     341757      +4190     
+ Misses       105323     100975      -4348     
- Partials      20860      21482       +622     
Flag Coverage Δ
integration 33.9343% <35.8611%> (?)

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 57.2570% <35.8611%> (+11.8252%) ⬆️
---- 🚨 Try these New Features:

Signed-off-by: Wenqi Mou <[email protected]>
Copy link

ti-chi-bot bot commented Nov 25, 2024

@Tristan1900: The following tests 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/check_dev f624281 link true /test check-dev
idc-jenkins-ci-tidb/unit-test f624281 link true /test unit-test
pull-br-integration-test f624281 link true /test pull-br-integration-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/test-infra 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
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.

br: add table filter for Pitr restore
1 participant