pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.2k stars 490 forks source link

Fix(volume): fix unexpected pod restart during resize storage size #5602

Closed ideascf closed 3 months ago

ideascf commented 3 months ago

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

Tests

Side effects

Related changes

Release Notes

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

codecov-commenter commented 3 months ago

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 ```diff @@ 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](https://app.codecov.io/gh/pingcap/tidb-operator/pull/5602/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [e2e](https://app.codecov.io/gh/pingcap/tidb-operator/pull/5602/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `48.28% <58.92%> (?)` | | | [unittest](https://app.codecov.io/gh/pingcap/tidb-operator/pull/5602/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `61.45% <34.61%> (-0.04%)` | :arrow_down: |
csuzhangxc commented 3 months ago

/run-all-tests

csuzhangxc commented 3 months ago

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

csuzhangxc commented 3 months ago

/run-all-tests

csuzhangxc commented 3 months ago

/run-pull-e2e-kind-basic

csuzhangxc commented 3 months ago

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

csuzhangxc commented 3 months ago

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

ti-chi-bot[bot] commented 3 months ago

[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: - ~~[OWNERS](https://github.com/pingcap/tidb-operator/blob/master/OWNERS)~~ [csuzhangxc] 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[bot] commented 3 months ago

[LGTM Timeline notifier]

Timeline:

csuzhangxc commented 3 months ago

/cherry-pick release-1.5

ti-chi-bot commented 3 months ago

@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](https://github.com/pingcap/tidb-operator/pull/5602#issuecomment-2041325732): >/cherry-pick release-1.5 Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.
ti-chi-bot commented 3 months ago

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

In response to [this](https://github.com/pingcap/tidb-operator/pull/5602#issuecomment-2041325732): >/cherry-pick release-1.5 Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.