fix(cluster): fix deletion when pd addr is not updated#6548
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/v2 #6548 +/- ##
==============================================
- Coverage 40.39% 40.35% -0.05%
==============================================
Files 366 366
Lines 20362 20383 +21
==============================================
Hits 8226 8226
- Misses 12136 12157 +21
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fgksgf The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a deletion bug where instances could not be deleted when the PD (Placement Driver) address was not updated, even when the entire cluster was being deleted. The fix reorders conditional checks in the reconciliation logic to prioritize cluster deletion over PD address validation.
- Moved the PD address validation check to occur after the cluster deletion check across all component controllers
- Ensures that when a cluster is being deleted, all subresources and finalizers are removed directly without requiring PD address to be registered
- Applied consistently across 9 different component controllers (TSO, TiProxy, TiKV, TiFlash, TiDB, TiCDC, Scheduling, Scheduler, and ReplicationWorker)
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/controllers/tso/builder.go | Reordered checks to allow TSO instance deletion when cluster is deleting |
| pkg/controllers/tiproxy/builder.go | Reordered checks to allow TiProxy instance deletion when cluster is deleting |
| pkg/controllers/tikv/builder.go | Reordered checks to allow TiKV instance deletion when cluster is deleting |
| pkg/controllers/tiflash/builder.go | Reordered checks to allow TiFlash instance deletion when cluster is deleting |
| pkg/controllers/tidb/builder.go | Reordered checks to allow TiDB instance deletion when cluster is deleting |
| pkg/controllers/ticdc/builder.go | Reordered checks to allow TiCDC instance deletion when cluster is deleting |
| pkg/controllers/scheduling/builder.go | Reordered checks to allow Scheduling instance deletion when cluster is deleting |
| pkg/controllers/scheduler/builder.go | Reordered checks to allow Scheduler instance deletion when cluster is deleting |
| pkg/controllers/replicationworker/builder.go | Reordered checks to allow ReplicationWorker instance deletion when cluster is deleting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: liubo02 <liubo02@pingcap.com>
29816b2 to
749f857
Compare
|
/cherry-pick release-2.0 |
|
@liubog2008: once the present PR merges, I will cherry-pick it on top of release-2.0 in the new PR and assign it to you. DetailsIn 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. |
|
@liubog2008: new pull request created to branch DetailsIn 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. |
If pd addr is not updated, instances cannot be deleted even if the whole cluster is deleting.