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 #879 Statefulset should consider non-available pods when deleting… #880

Merged
merged 2 commits into from
Jan 6, 2022

Conversation

hzyfox
Copy link
Contributor

@hzyfox hzyfox commented Jan 5, 2022

Ⅰ. Describe what this PR does

fixes #879 , use isRunningAndAvailable to instead of isRunningAndReady

Ⅱ. Does this pull request fix one issue?

fixes #879

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

@kruise-bot kruise-bot requested review from Fei-Guo and FillZpp January 5, 2022 16:13
@kruise-bot kruise-bot added the size/XS size/XS: 0-9 label Jan 5, 2022
…n deleting pods

Signed-off-by: 孤月 <guyue.hzy@alibaba-inc.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2022

Codecov Report

Merging #880 (33c2c4e) into master (73ae292) will decrease coverage by 0.30%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #880      +/-   ##
==========================================
- Coverage   48.23%   47.93%   -0.31%     
==========================================
  Files         118      119       +1     
  Lines       11016    11237     +221     
==========================================
+ Hits         5314     5386      +72     
- Misses       4897     5037     +140     
- Partials      805      814       +9     
Flag Coverage Δ
unittests 47.93% <0.00%> (-0.31%) ⬇️

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

Impacted Files Coverage Δ
pkg/controller/statefulset/stateful_set_control.go 62.50% <0.00%> (-0.20%) ⬇️
pkg/control/sidecarcontrol/util.go 49.03% <0.00%> (-5.72%) ⬇️
pkg/controller/sidecarset/sidecarset_processor.go 70.00% <0.00%> (-4.14%) ⬇️
...rcedistribution/resourcedistribution_controller.go 27.16% <0.00%> (-3.55%) ⬇️
...g/webhook/resourcedistribution/validating/utils.go 75.00% <0.00%> (-3.27%) ⬇️
pkg/control/sidecarcontrol/sidecarset_control.go 36.63% <0.00%> (-1.52%) ⬇️
...ting/resourcedistribution_create_update_handler.go 59.61% <0.00%> (-1.10%) ⬇️
pkg/util/pods.go 19.62% <0.00%> (-0.97%) ⬇️
pkg/webhook/pod/mutating/sidecarset.go 73.52% <0.00%> (-0.73%) ⬇️
...k/statefulset/validating/statefulset_validation.go 51.93% <0.00%> (-0.29%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73ae292...33c2c4e. Read the comment docs.

@@ -581,9 +581,9 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet(
continue
}
// if we are in monotonic mode and the condemned target is not the first unhealthy Pod block
if !isRunningAndReady(condemned[target]) && monotonic && condemned[target] != firstUnhealthyPod {
if avail, _ := isRunningAndAvailable(condemned[target], minReadySeconds); !avail && monotonic && condemned[target] != firstUnhealthyPod {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should also put the available wait time into durationStore to trigger reconcile after this time.

isAvailable, waitTime := isRunningAndAvailable(condemned[target], minReadySeconds)

durationStore.Push(getStatefulSetKey(set), waitTime)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

…n deleting pods

Signed-off-by: 孤月 <guyue.hzy@alibaba-inc.com>
Copy link
Member

@FillZpp FillZpp left a comment

Choose a reason for hiding this comment

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

/lgtm

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FillZpp

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

@kruise-bot kruise-bot merged commit 955268f into openkruise:master Jan 6, 2022
FillZpp pushed a commit that referenced this pull request Jan 21, 2022
#880)

* fix #879 Statefulset should consider non-available pods when deleting pods

Signed-off-by: 孤月 <guyue.hzy@alibaba-inc.com>

* fix #879 Statefulset should consider non-available pods when deleting pods

Signed-off-by: 孤月 <guyue.hzy@alibaba-inc.com>
ppbits pushed a commit to ppbits/kruise that referenced this pull request Apr 4, 2024
…n deleting… (openkruise#880)

* fix openkruise#879 Statefulset should consider non-available pods when deleting pods


* fix openkruise#879 Statefulset should consider non-available pods when deleting pods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Statefulset should consider non-available pods when deleting pods
4 participants