-
Notifications
You must be signed in to change notification settings - Fork 771
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
Update stateful_set_utils.go #1136
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -542,21 +542,35 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet( | |
status.UpdatedReplicas++ | ||
} | ||
// if the set does not allow bursting, return immediately | ||
if monotonic || decreaseAndCheckMaxUnavailable(scaleMaxUnavailable) { | ||
if monotonic { | ||
return &status, nil | ||
} else if decreaseAndCheckMaxUnavailable(scaleMaxUnavailable) { | ||
klog.V(4).Infof( | ||
"StatefulSet %s/%s Pod %s is Creating, and break pods scale", | ||
set.Namespace, | ||
set.Name, | ||
replicas[i].Name) | ||
break | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On 545 line, the original writing method should be maintained. It will be not destroy the semantics of scaleStrategy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is convenient for you, you can communicate on the zoom of the community meeting on 12.8. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
// pod created, no more work possible for this round | ||
continue | ||
} | ||
// If we find a Pod that is currently terminating, we must wait until graceful deletion | ||
// completes before we continue to make progress. | ||
if isTerminating(replicas[i]) && (monotonic || decreaseAndCheckMaxUnavailable(scaleMaxUnavailable)) { | ||
if isTerminating(replicas[i]) && monotonic { | ||
klog.V(4).Infof( | ||
"StatefulSet %s/%s is waiting for Pod %s to Terminate", | ||
set.Namespace, | ||
set.Name, | ||
replicas[i].Name) | ||
return &status, nil | ||
} else if isTerminating(replicas[i]) && decreaseAndCheckMaxUnavailable(scaleMaxUnavailable) { | ||
klog.V(4).Infof( | ||
"StatefulSet %s/%s Pod %s is Terminating, and break pods scale", | ||
set.Namespace, | ||
set.Name, | ||
replicas[i].Name) | ||
break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. klog.V(4).Infof( |
||
} | ||
// Update InPlaceUpdateReady condition for pod | ||
if res := ssc.inplaceControl.Refresh(replicas[i], nil); res.RefreshErr != nil { | ||
|
@@ -571,7 +585,7 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet( | |
// ordinal, are Running and Available. | ||
if monotonic || scaleMaxUnavailable != nil { | ||
isAvailable, waitTime := isRunningAndAvailable(replicas[i], minReadySeconds) | ||
if !isAvailable && (monotonic || decreaseAndCheckMaxUnavailable(scaleMaxUnavailable)) { | ||
if !isAvailable && monotonic { | ||
if waitTime > 0 { | ||
// make sure we check later | ||
durationStore.Push(getStatefulSetKey(set), waitTime) | ||
|
@@ -591,6 +605,17 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet( | |
replicas[i].Name) | ||
} | ||
return &status, nil | ||
} else if !isAvailable && decreaseAndCheckMaxUnavailable(scaleMaxUnavailable) { | ||
klog.V(4).Infof( | ||
"StatefulSet %s/%s Pod %s is unavailable, and break pods scale", | ||
set.Namespace, | ||
set.Name, | ||
replicas[i].Name) | ||
if waitTime > 0 { | ||
// make sure we check later | ||
durationStore.Push(getStatefulSetKey(set), waitTime) | ||
} | ||
break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. klog.V(4).Infof( |
||
} | ||
} | ||
// Enforce the StatefulSet invariants | ||
|
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.
klog.V(4).Infof(
"StatefulSet %s/%s Pod %s is Creating, and break pods scale",
set.Namespace,
set.Name,
replicas[i].Name)