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: log backup checkpoint ts can be updated when operator restart #4746

Merged

Conversation

WizardXiao
Copy link
Contributor

@WizardXiao WizardXiao commented Oct 17, 2022

What problem does this PR solve?

Closes #4745

What is changed and how does it work?

  1. The root casuse is the log backup will be added to the tracker only when it is started, but log backup is already running after operator restart. so tracker lose the log backup after restart.
  2. this pr will list all log backup and add them to tracker when tracker init which will be called once in operator. the instance in operator main --> backup controller --> backup manager --> backup tracker is only one in operator.
  3. On the whole,the main processes of the log backup track:
    a. tracker init will try to find all log backup and add them to the map which key is namespack and cluster.
    b. log backup start will add it to the map
    c. if add log backup to the map successfully, it will start a go routine which has a loop to track log backup's checkpoint ts and will stop when log backup complete.
    d. by the way, add or delete the map has a mutex.

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.

Fix the issue that the log backup checkpoint ts will not be updated when the tidb operator restarts.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • KanShiori
  • csuzhangxc

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2022

Codecov Report

Merging #4746 (e204c89) into master (ec8974c) will increase coverage by 9.09%.
The diff coverage is 55.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4746      +/-   ##
==========================================
+ Coverage   61.22%   70.32%   +9.09%     
==========================================
  Files         212      216       +4     
  Lines       23855    26715    +2860     
==========================================
+ Hits        14606    18786    +4180     
+ Misses       7884     6524    -1360     
- Partials     1365     1405      +40     
Flag Coverage Δ
e2e 56.10% <52.50%> (?)
unittest 61.20% <28.94%> (-0.02%) ⬇️

pkg/backup/backup/backup_tracker.go Outdated Show resolved Hide resolved
pkg/backup/backup/backup_tracker.go Outdated Show resolved Hide resolved
@ti-chi-bot
Copy link
Member

@WangLe1321: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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 ti-community-infra/tichi repository.

Copy link
Contributor

@grovecai grovecai left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Member

@grovecai: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

LGTM

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 ti-community-infra/tichi repository.

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind-across-kubernetes

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind pull-e2e-kind-across-kubernetes

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

1 similar comment
@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@KanShiori
Copy link
Collaborator

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 8bdf05a

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

7 similar comments
@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao WizardXiao mentioned this pull request Oct 21, 2022
2 tasks
@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

4 similar comments
@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@ti-chi-bot
Copy link
Member

@WizardXiao: Your PR was out of date, I have automatically updated it for you.

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 ti-community-infra/tichi repository.

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind-across-kubernetes

1 similar comment
@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind-across-kubernetes

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

1 similar comment
@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind-across-kubernetes

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind

@WizardXiao
Copy link
Contributor Author

/test pull-e2e-kind-across-kubernetes

@ti-chi-bot ti-chi-bot merged commit e7dbf6a into pingcap:master Oct 21, 2022
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.

BR: can not update log backup checkpoint ts when operator restart
7 participants