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

backup,restore: support backing up / restore system databases (#1048) #1078

Merged
merged 2 commits into from
May 27, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Apr 30, 2021

cherry-pick #1048 to release-5.0
You can switch your code base to this Pull Request by using git-extras:

# In br repo:
git pr https://github.com/pingcap/br/pull/1078

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/br.git pr/1078:release-5.0-b1ed36512074

What problem does this PR solve?

#872 and #679.

But this doesn't allow restore stats -- because the table IDs of the stats backed up are old table IDs, we need more efforts to rewrite them to make them take effect after the restoration.

What is changed and how it works?

This PR basically implemented #679 (comment), with some difference:

  • When the target table not exists, RENAME TABLE temp.xxx TO mysql.xxx would be used, for effectively restoring user tables created in mysql schema.
  • The user interface is the -f (the table filter) flag. Users must specify each table they want to restore by the table filter syntax (e.g. br restore full -f '*.*' -f '!mysql.*' -f 'mysql.usertable' to restore mysql.usertable).

Check List

Tests

  • Integration test

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
    • The document points out that table filter would always ignore system tables, that isn't real after this merged.
    • The usage of this feature.

Release Note

  • BR now support backing up user tables created in the mysql schema.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@YuJuncen
Copy link
Collaborator

listen tcp 0.0.0.0:10080: bind: address already in use

/run-integration-tests

@kennytm
Copy link
Collaborator

kennytm commented May 5, 2021

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 LGTM1 label May 5, 2021
@3pointer 3pointer added this to the v5.0.1 milestone May 11, 2021
@3pointer
Copy link
Collaborator

/run-all-tests

@3pointer
Copy link
Collaborator

/run-integration-tests

@3pointer
Copy link
Collaborator

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • kennytm

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels May 26, 2021
@3pointer
Copy link
Collaborator

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 60f6d11

@lonng
Copy link
Contributor

lonng commented May 27, 2021

/merge

@lonng lonng modified the milestones: v5.0.1, v5.0.2 May 27, 2021
@lonng
Copy link
Contributor

lonng commented May 27, 2021

/run-all-tests

@ti-chi-bot ti-chi-bot merged commit f95390a into pingcap:release-5.0 May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants