Fix issue in VolumeReplace feature that may block replacement when combined with an annotation change (#5382) #5383
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #5382
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.