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

Fix issue in VolumeReplace feature that may block replacement when combined with an annotation change (#5382) #5383

Merged

Conversation

ti-chi-bot
Copy link
Member

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:

newSet.Spec.Template.Spec = *podSpec

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 :

updateStrategy.Type = apps.OnDeleteStatefulSetStrategyType

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

  • 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 an issue where VolumeReplacement feature can get stuck when a disk change is clubbed with a metadata(annotation) change

Copy link
Contributor

ti-chi-bot bot commented Nov 10, 2023

[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 bornchanger for approval. For more information see the Kubernetes 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

@ti-chi-bot ti-chi-bot bot requested a review from shonge November 10, 2023 09:08
@codecov-commenter
Copy link

Codecov Report

Merging #5383 (80bfc40) into release-1.5 (209d30f) will increase coverage by 0.03%.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-1.5    #5383      +/-   ##
===============================================
+ Coverage        61.65%   61.69%   +0.03%     
===============================================
  Files              228      228              
  Lines            28847    28845       -2     
===============================================
+ Hits             17787    17796       +9     
+ Misses            9320     9314       -6     
+ Partials          1740     1735       -5     
Flag Coverage Δ
unittest 61.69% <ø> (+0.03%) ⬆️

@csuzhangxc csuzhangxc merged commit f8f3bfe into pingcap:release-1.5 Nov 10, 2023
4 checks passed
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.

4 participants