-
Notifications
You must be signed in to change notification settings - Fork 500
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
Fix issue in VolumeReplace feature that may block replacement when combined with an annotation change #5382
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5382 +/- ##
==========================================
- Coverage 61.61% 61.58% -0.03%
==========================================
Files 228 228
Lines 28866 28864 -2
==========================================
- Hits 17785 17776 -9
- Misses 9339 9344 +5
- Partials 1742 1744 +2
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: csuzhangxc 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 |
[LGTM Timeline notifier]Timeline:
|
/cherry-pick release-1.5 |
@csuzhangxc: once the present PR merges, I will cherry-pick it on top of release-1.5 in the new PR and assign it to you. 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. |
@csuzhangxc: new pull request created to branch 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. |
What problem does this PR solve?
Fix an issue with Volume Replacement feature that can cause it to be blocked when user requests a metadata / annotation change, clubbed with a disk replacement.
What is changed and how does it work?
Remove check in pvc_replacer that checks if sts is upgrading before recreating sts.
If a disk change is clubbed with pod spec changes (but not metadata changes), it gets reverted here:
tidb-operator/pkg/manager/member/tikv_member_manager.go
Line 276 in 6de4871
So the statefulset would not show any changes (and would not fail upgrade check, so issue doesn't happen).
However metadata changes like (annotation change), do not get reverted, and will be applied to the sts, but since volume replace marks the update strategy to be OnDelete :
tidb-operator/pkg/manager/member/tikv_member_manager.go
Line 691 in 6de4871
The annotation won't be applied, and will be stuck.
Further pvc_replacer will be stuck forever on this check (which is removed in this PR)
The check itself is unnecessary since, before the code reaches here we are already in volume replace mode, which means sts should have OnDelete strategy and sts updates will only be performed by pvc_replacer clubbed with disk replace.
Code changes
Tests
Side effects
Related changes
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.