Skip to content

Conversation

cjc7373
Copy link
Contributor

@cjc7373 cjc7373 commented Aug 28, 2025

No description provided.

@apecloud-bot
Copy link
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.0

@github-actions github-actions bot added the size/M Denotes a PR that changes 30-99 lines. label Aug 28, 2025
@cjc7373 cjc7373 added the pick-1.0 Auto cherry-pick to release-1.0 when PR merged label Aug 28, 2025
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 64.70588% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.66%. Comparing base (605b802) to head (4006ead).

Files with missing lines Patch % Lines
pkg/controller/instanceset/reconciler_update.go 0.00% 10 Missing ⚠️
controllers/workloads/instance_controller.go 74.07% 5 Missing and 2 partials ⚠️
...ps/component/transformer_component_workload_ops.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9672      +/-   ##
==========================================
+ Coverage   59.60%   59.66%   +0.06%     
==========================================
  Files         551      551              
  Lines       59739    59771      +32     
==========================================
+ Hits        35607    35663      +56     
+ Misses      20888    20856      -32     
- Partials     3244     3252       +8     
Flag Coverage Δ
unittests 59.66% <64.70%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cjc7373 cjc7373 marked this pull request as ready for review August 28, 2025 07:19
@cjc7373 cjc7373 requested review from a team and leon-inf as code owners August 28, 2025 07:19
// during events such as planned maintenance or when performing stop, shutdown, restart, or upgrade operations.
// In a typical consensus system, this action is used to transfer leader role to another replica.
//
// When a pod is about to be updated, a switchover action will be triggered to it. So addon implementation must determine
Copy link
Contributor

Choose a reason for hiding this comment

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

A switchover action will be triggered for it, but it doesn't mean the action must be executed on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. The real problem I encountered is

lfa, err := lifecycle.New(its.Namespace, clusterName, its.Name, lifecycleActions, templateVars, pod)

Here when triggering switchover, only the pod that need to be switched is passed to lifecycle.New. So setting a targetPodSelector will make all switchover action fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is an implementation issue and can be fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reconfigure action has the same issue. Does it follow the same logic?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, same logic here.

@cjc7373 cjc7373 changed the title chore: validate that switchover action does not have targetPodSelector fix: always select all available pods when running action Aug 29, 2025
@github-actions github-actions bot added size/L Denotes a PR that changes 100-499 lines. and removed size/M Denotes a PR that changes 30-99 lines. labels Aug 29, 2025
@cjc7373 cjc7373 requested a review from leon-inf September 3, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pick-1.0 Auto cherry-pick to release-1.0 when PR merged size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants