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(volume): fix unexpected pod restart during resize storage size #5602

Conversation

ideascf
Copy link
Contributor

@ideascf ideascf commented Apr 2, 2024

This PR fixes #5601. Store currently using ConfigMap name into tc.annotations before delete STS when do resize storage size. And then retrieve it to overwrite ConfigMap name in the STS recreation to remain name unchanged.

What problem does this PR solve?

What is changed and how does it work?

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.


@ti-chi-bot ti-chi-bot bot requested a review from shonge April 2, 2024 05:25
@ideascf ideascf force-pushed the fix-unexpected-restart-during-resizing-storage-size branch from 73a4db3 to afa4e56 Compare April 2, 2024 05:27
@ideascf ideascf force-pushed the fix-unexpected-restart-during-resizing-storage-size branch from afa4e56 to 45f8f57 Compare April 2, 2024 05:35
Comment on lines 75 to 77
if !equality.Semantic.DeepEqual(cmInAnno.Data, cm.Data) {
return false, fmt.Errorf("unexpected ConfigMap data change. comp=%s, name=%s, nameInAnno=%s", componentType, cm.Name, cmNameInAnno)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To ensure no ConfigMap data changed between delete and recreate STS

@@ -235,6 +235,9 @@ func (m *tiproxyMemberManager) syncStatefulSet(tc *v1alpha1.TidbCluster) error {
}

if stsNotExist {
if _, err := mngerutils.KeepConfigMapNameUnchangedWhenCreateSTS(klog.V(4), m.deps.ConfigMapLister, tc, v1alpha1.PDMemberType, cm); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

TiProxyMemberType

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed. ab80380

@codecov-commenter
Copy link

codecov-commenter commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 58.92857% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 67.78%. Comparing base (72bccb5) to head (f50b3c4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5602      +/-   ##
==========================================
+ Coverage   61.49%   67.78%   +6.28%     
==========================================
  Files         235      246      +11     
  Lines       30337    34278    +3941     
==========================================
+ Hits        18655    23234    +4579     
+ Misses       9813     9134     -679     
- Partials     1869     1910      +41     
Flag Coverage Δ
e2e 48.28% <58.92%> (?)
unittest 61.45% <34.61%> (-0.04%) ⬇️

ideascf and others added 4 commits April 3, 2024 15:58
if the configmap has been changed during paused stage, the
FindConfigMapNameFromTCAnno refuse the creation. But in some situations,
configmap data changes are expected, for example: changing config when
the cluster is paused.
@csuzhangxc
Copy link
Member

/run-all-tests

@csuzhangxc
Copy link
Member

/run-pull-e2e-kind-across-kubernetes

@csuzhangxc
Copy link
Member

/run-all-tests

@csuzhangxc
Copy link
Member

/run-pull-e2e-kind-basic

@csuzhangxc
Copy link
Member

/run-pull-e2e-kind-across-kubernetes

@csuzhangxc
Copy link
Member

/run-pull-e2e-kind-tikv-scale-simultaneously

@ti-chi-bot ti-chi-bot bot added the lgtm label Apr 7, 2024
Copy link
Contributor

ti-chi-bot bot commented Apr 7, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

ti-chi-bot bot commented Apr 7, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-07 05:56:38.450074516 +0000 UTC m=+769059.977615247: ☑️ agreed by csuzhangxc.

@ti-chi-bot ti-chi-bot bot added the approved label Apr 7, 2024
@csuzhangxc
Copy link
Member

/cherry-pick release-1.5

@ti-chi-bot
Copy link
Member

@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:

/cherry-pick release-1.5

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.

@ti-chi-bot ti-chi-bot bot merged commit b02b98f into pingcap:master Apr 7, 2024
13 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tidb-operator that referenced this pull request Apr 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

@csuzhangxc: new pull request created to branch release-1.5: #5609.

In response to this:

/cherry-pick release-1.5

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.

@ideascf ideascf deleted the fix-unexpected-restart-during-resizing-storage-size branch April 7, 2024 06:13
csuzhangxc added a commit that referenced this pull request Apr 8, 2024
…5602) (#5609)

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Co-authored-by: ideascf <fei.chen@pingcap.com>
Co-authored-by: csuzhangxc <csuzhangxc@gmail.com>
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.

Unexpected pod restart during resize storage size of tikv
4 participants