-
Notifications
You must be signed in to change notification settings - Fork 527
fix(updater): optimize no inplace update #6533
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(updater): optimize no inplace update #6533
Conversation
ea02062 to
2d451fa
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/v2 #6533 +/- ##
==============================================
+ Coverage 40.99% 41.09% +0.09%
==============================================
Files 366 366
Lines 20294 20328 +34
==============================================
+ Hits 8320 8354 +34
Misses 11974 11974
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Signed-off-by: liubo02 <liubo02@pingcap.com>
75f5698 to
592dcef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the topology-aware update policy to distinguish between scale-in and update operations, and fixes pod deletion time tracking in E2E tests.
Key changes:
- Introduces separate
PolicyScaleIn()andPolicyUpdate()methods to handle different topology preferences for scaling in versus updating instances - Updates pod watcher to use the Kubernetes watch event type for more accurate deletion time tracking
- Removes redundant
WaitForInstanceListRecreatedcalls from E2E tests
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/utils/waiter/pod.go | Changes deletion time tracking to use watch.Deleted event instead of DeletionTimestamp for more accurate timing |
| tests/e2e/tiproxy/tiproxy.go | Removes redundant WaitForInstanceListRecreated calls |
| tests/e2e/tidb/topology.go | Removes redundant WaitForInstanceListRecreated calls |
| tests/e2e/tidb/tidb.go | Removes redundant WaitForInstanceListRecreated calls |
| tests/e2e/framework/action/test.go | Removes redundant WaitForInstanceListRecreated call |
| pkg/updater/policy/topology_test.go | Adds test coverage for expectedUpdatePrefered field and separate PolicyUpdate assertions |
| pkg/updater/policy/topology.go | Refactors TopologyPolicy interface to provide separate PolicyScaleIn() and PolicyUpdate() methods instead of a single Prefer method |
| pkg/updater/executor_test.go | Updates test to match new Update signature and removes unused RecordedActions method |
| pkg/updater/executor.go | Updates Update method signature to accept unavailable parameter and adds documentation |
| pkg/updater/builder.go | Reorders policy priority to put PreferUnready and PreferNotRunning first |
| pkg/updater/actor.go | Implements logic to handle unavailable parameter in Update method |
| pkg/controllers/*/tasks/updater.go | Updates all controllers to use PolicyScaleIn() method; TiDBGroup and TiProxyGroup also add PolicyUpdate() |
Comments suppressed due to low confidence (2)
pkg/controllers/tsogroup/tasks/updater.go:108
- The TSO group updater is missing
topoPolicy.PolicyUpdate()in its update prefer policies, while similar controllers (TiDBGroup and TiProxyGroup) include both NotLeaderPolicy() and topoPolicy.PolicyUpdate(). This inconsistency means TSO instances won't benefit from topology-aware update preferences during rolling updates.
WithUpdatePreferPolicy(
NotLeaderPolicy(),
).
pkg/controllers/pdgroup/tasks/updater.go:107
- The PD group updater is missing
topoPolicy.PolicyUpdate()in its update prefer policies, while similar controllers (TiDBGroup and TiProxyGroup) include both NotLeaderPolicy() and topoPolicy.PolicyUpdate(). This inconsistency means PD instances won't benefit from topology-aware update preferences during rolling updates.
WithUpdatePreferPolicy(
NotLeaderPolicy(),
).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkg/updater/actor.go
Outdated
| } | ||
|
|
||
| return nil | ||
| return fmt.Errorf("want to update an unavailable outdated, buut choosed %s is not", name) |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'buut' to 'but'.
| return fmt.Errorf("want to update an unavailable outdated, buut choosed %s is not", name) | |
| return fmt.Errorf("want to update an unavailable outdated, but choosed %s is not", name) |
| WithScaleInPreferPolicy( | ||
| topoPolicy, | ||
| topoPolicy.PolicyScaleIn(), | ||
| ). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add WithUpdatePreferPolicy for ticdc?
Signed-off-by: liubo02 <liubo02@pingcap.com>
|
[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:
|
Fix #6530