Skip to content

Rolling updater enhancements - #3701

Merged
openshift-bot merged 3 commits into
openshift:masterfrom
ironcladlou:rolling-updater-enhancements
Jul 22, 2015
Merged

openshift-bot merged 3 commits into
openshift:masterfrom
ironcladlou:rolling-updater-enhancements

Conversation

@ironcladlou

Copy link
Copy Markdown
Contributor

Integrate with upstream rolling update enhancements.

  • Tweak the update acceptor to support being invoked on every update
    interval for a deployment.
  • Update rolling params API to support updatePercent passed through
    to the upstream rolling updater.

Integrates deployments with kubernetes/kubernetes#10062.

Closes #2828.
Fixes #3313.

@ironcladlou

Copy link
Copy Markdown
Contributor Author

@Kargakis @deads2k PTAL.

@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch from 1591ca1 to 454ed77 Compare July 14, 2015 18:40
@deads2k

deads2k commented Jul 14, 2015

Copy link
Copy Markdown
Contributor

Did you regenerate conversions too?

Comment thread pkg/deploy/api/types.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should have fail unit tests. No json on internal types

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What unit test should have failed it? They're passing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch from 454ed77 to ae1a2e7 Compare July 14, 2015 19:42

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why don't we break here? We're going to check only one pod, but claim we know about all of the pods?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes: we need to keep track of all pods known for the controller so the next time we do verification we don't re-check a pod from the previous set.

@deads2k

deads2k commented Jul 14, 2015

Copy link
Copy Markdown
Contributor

I wasn't involved the initial review of this item. This pull looks like minor fitting of an existing feature for upstream refactoring. The fitting looks pretty reasonable, but I think you'll need to get to the original reviewer to sign off. Could you also link me to the original pull?

@ironcladlou

Copy link
Copy Markdown
Contributor Author

@Kargakis can review this in more depth.

@ironcladlou

Copy link
Copy Markdown
Contributor Author

@smarterclayton I'd also like you to review the UpdateAcceptor implementation change to make sure it aligns with the new semantics (to verify on every interval).

@smarterclayton

Copy link
Copy Markdown
Contributor

We need to have a way to set the internal to either be "up first" or "down first". So scaling old down by X percent first, then scaling new up by Y. This is required for us to support scale in place when # replicas = available target nodes.

Comment thread pkg/deploy/api/validation/validation.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are missing 1 and 100 here. So

(*params.UpdatePercent <= 1 || *params.UpdatePercent >= 100)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But 1 and 100 are valid values...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nvmd, it was early in the morning.

@0xmichalis

Copy link
Copy Markdown
Contributor

A validation fix and nits

@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch 3 times, most recently from d5bba7d to e67dea0 Compare July 15, 2015 12:58
@ironcladlou

Copy link
Copy Markdown
Contributor Author

@smarterclayton

We need to have a way to set the internal to either be "up first" or "down first". So scaling old down by X percent first, then scaling new up by Y. This is required for us to support scale in place when # replicas = available target nodes.

This needs to be a followup issue.

@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch from e67dea0 to 0571a7a Compare July 15, 2015 13:05
@ironcladlou

Copy link
Copy Markdown
Contributor Author

[test]

@openshift-bot

Copy link
Copy Markdown
Contributor

@smarterclayton

Copy link
Copy Markdown
Contributor

Why?

On Jul 15, 2015, at 9:00 AM, Dan Mace [email protected] wrote:

@smarterclayton https://github.com/smarterclayton

We need to have a way to set the internal to either be "up first" or "down
first". So scaling old down by X percent first, then scaling new up by Y.
This is required for us to support scale in place when # replicas =
available target nodes.

This needs to be a followup issue.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

@ironcladlou

Copy link
Copy Markdown
Contributor Author

@smarterclayton

Why?

Because that's a fundamental and orthogonal change to the upstream mechanism that we hadn't previously discussed.

The way we designed the current UpdateAcceptor patch we're carrying is "only accept once regardless of the interval count," then during the tunables work the requirements changed to "accept every interval," which led to me having to refactor the acceptor implementation as you see here. Now we're getting into even more unanticipated design discussion about the newly refactored update acceptor which I hadn't even intended to change for the tunables issue in the first place.

I'm already pretty uncomfortable rolling the UpdateAcceptor and tunables work together. I don't want to introduce a third change which really could be made separately after we've got some agreement on the preceding designs on which it would be based.

@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch from 0571a7a to d8485fd Compare July 15, 2015 14:56
@smarterclayton

Copy link
Copy Markdown
Contributor

Delivering features that don't quite work doesn't help us. Can you tell me
what the design for the initial tunable I asked for would work? The scale
down first vs scale up first is a blocker for registries and routers.
Percentages are just nice to haves.

On Wed, Jul 15, 2015 at 10:52 AM, Dan Mace [email protected] wrote:

@smarterclayton https://github.com/smarterclayton

Why?

Because that's a fundamental and orthogonal change to the upstream
mechanism that we hadn't previously discussed.

The way we designed the current UpdateAcceptor patch we're carrying is
"only accept once regardless of the interval count," then during the
tunables work the requirements changed to "accept every interval," which
led to me having to refactor the acceptor implementation as you see here.
Now we're getting into even more unanticipated design discussion about the
newly refactored update acceptor which I hadn't even intended to change for
the tunables issue in the first place.

I'm already pretty uncomfortable rolling the UpdateAcceptor and tunables
work together. I don't want to introduce a third change which really could
be made separately after we've got some agreement on the preceding designs
on which it would be based.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

Clayton Coleman | Lead Engineer, OpenShift

@ironcladlou

Copy link
Copy Markdown
Contributor Author

Is there some prior reference to the scale down then up requirement? Sounds like we need a new issue and card to take priority over this one.

@smarterclayton

Copy link
Copy Markdown
Contributor

I would just make -% alter the order (down before up)

On Wed, Jul 15, 2015 at 11:24 AM, Dan Mace [email protected] wrote:

Is there some prior reference to the scale down then up requirement?
Sounds like we need a new issue and card to take priority over this one.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

Clayton Coleman | Lead Engineer, OpenShift

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This log needs vetting

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I really wanted to emit progress at V(0) but I'm not sure of a great/all-purpose way to rate limit the output when the interval is short. Thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should spawn a follow up on the usability of output. Let's get this
closedz

On Jul 21, 2015, at 9:11 AM, Dan Mace [email protected] wrote:

In pkg/deploy/strategy/support/lifecycle.go
#3701 (comment):

      return true, nil
  }
  // Otherwise, try again later.
  • glog.V(4).Infof("Still waiting for pod %s/%s container readiness; observed statuses: #%v", pod.Namespace, pod.Name, observedContainers)
    
  • glog.V(4).Infof("Still waiting for %d of %s pods to become ready for deployment %s", len(observedPodContainers), unreadyPods, unreadyContainers, deployutil.LabelForDeployment(deployment))
    

I really wanted to emit progress at V(0) but I'm not sure of a
great/all-purpose way to rate limit the output when the interval is short.
Thoughts?

—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/3701/files#r35099349.

@ironcladlou

Copy link
Copy Markdown
Contributor Author

Thought experiment - for us to complete a deployment, 100-N% pods have to be ready. I don't think we would fail a deployment (or block progress) if <N% are not ready (when update percentage is negative) or 100% (when update percentage is positive). How hard is that to implement? Basically we just need to maintain the SLA invariant (must always have that 100-N% running). Can we do that safely?

So imagine this scenario:

UpdatePercent: -10%
SLA: 90%
Desired replicas: 100

i  old  new  ready(old+new)

0  100   0   100 
1  90   10   90  <-- accepted without waiting for readiness, SLA still met
2  80   20   89  <-- only 9 of i=1 are ready

Since the full percent increment will always be scaled down to the SLA threshold right before scale up/acceptance, I don't yet an alternative to waiting for all of the newly scaled-up pods to be ready. If we don't fully replace the scaled-down chunk from the start of the interval, we risk dipping below the SLA by our unready pods racing with the next interval's scale-down.

@smarterclayton

Copy link
Copy Markdown
Contributor

What if we altered the scale interval to account for unready?

I don't want to fail a 100 pod deploy because a node is bad. Which is what
happens now.

On Jul 21, 2015, at 10:02 AM, Dan Mace [email protected] wrote:

Thought experiment - for us to complete a deployment, 100-N% pods have to
be ready. I don't think we would fail a deployment (or block progress) if
<N% are not ready (when update percentage is negative) or 100% (when update
percentage is positive). How hard is that to implement? Basically we just
need to maintain the SLA invariant (must always have that 100-N% running).
Can we do that safely?

So imagine this scenario:

UpdatePercent: -10%
SLA: 90%
Desired replicas: 100

i old new ready(old+new)

0 100 0 100
1 90 10 90 <-- accepted without waiting for readiness, SLA still met
2 80 20 89 <-- only 9 of i=1 are ready

Since the full percent increment will always be scaled down to the SLA
threshold
right before scale up/acceptance, I don't yet an alternative to
waiting for all of the newly scaled-up pods to be ready. If we don't fully
replace the scaled-down chunk from the start of the interval, we risk
dipping below the SLA by our unready pods racing with the next interval's
scale-down.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

@ironcladlou

Copy link
Copy Markdown
Contributor Author

What if we altered the scale interval to account for unready?

I don't follow... elaborate more on that idea?

I don't want to fail a 100 pod deploy because a node is bad. Which is what happens now.

Yeah. Still having trouble imagining how to solve it. To deconstruct the "node death" case further: if the node dies but the pods can still be scheduled elsewhere, there's no problem (other than the time counted against the timeout). If the node death means we can't schedule some of the pods for an interval, what recourse do we have? We can't predict if a future interval will fill in the gap if we were to ignore it, so we have to assume that the current interval is our only chance to keep us above the line. Maybe whatever you had in mind for scale alteration above relates to this.

@smarterclayton

Copy link
Copy Markdown
Contributor

On Jul 21, 2015, at 10:30 AM, Dan Mace [email protected] wrote:

What if we altered the scale interval to account for unready?

I don't follow... elaborate more on that idea?

I don't want to fail a 100 pod deploy because a node is bad. Which is what
happens now.

Yeah. Still having trouble imagining how to solve it. To deconstruct the
"node death" case further: if the node dies but the pods can still be
scheduled elsewhere, there's no problem (other than the time counted
against the timeout). If the node death means we can't schedule some of the
pods for an interval, what recourse do we have? We can't predict if a
future interval will fill in the gap if we were to ignore it, so we have to
assume that the current interval is our only chance to keep us above the
line. Maybe whatever you had in mind for scale alteration above relates to
this.

Treat update percent as the max scale interval. Only scale down to the
SLA. If zero can be scaled down, that's when the timeout window starts
(timeout defined as the last interval we could move forward on).

So if you have +10%, scale up, wait until pods are ready, scaled down
min(10% * N, ready - N). If you have -10%, scale down, scale up, as soon
as you have any ready do the next scale down, then scale up. By the time
you get to the second round, more pods from the first round have become
ready.

Basically, don't scale by fixed chunks. Scaled based on how many are ready.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

@ironcladlou

Copy link
Copy Markdown
Contributor Author

Treat update percent as the max scale interval. Only scale down to the SLA. If zero can be scaled down, that's when the timeout window starts (timeout defined as the last interval we could move forward on). So if you have +10%, scale up, wait until pods are ready, scaled down min(10% * N, ready - N). If you have -10%, scale down, scale up, as soon as you have any ready do the next scale down, then scale up. By the time you get to the second round, more pods from the first round have become ready. Basically, don't scale by fixed chunks. Scaled based on how many are ready.

I'm pretty sure this is all clear to me now and seems workable. Unfortunately, now we're back to...

How hard is that to implement?

The upstream code would need re-designed with this in mind. It would need to take on the responsibility of checking overall readiness each interval to recompute the scaling increment, or rely on the update acceptor to give it new values (or context to inform the computation), or something else.

@smarterclayton

Copy link
Copy Markdown
Contributor

Let's finish this out and treat at as a next step. What we have here is
strictly all necessary - we have introduced the concept that we don't
violate an SLA. But we are now in the case where one failure breaks the
CLA.

On Jul 21, 2015, at 10:56 AM, Dan Mace [email protected] wrote:

Treat update percent as the max scale interval. Only scale down to the SLA.
If zero can be scaled down, that's when the timeout window starts (timeout
defined as the last interval we could move forward on). So if you have
+10%, scale up, wait until pods are ready, scaled down min(10% * N, ready -
N). If you have -10%, scale down, scale up, as soon as you have any ready
do the next scale down, then scale up. By the time you get to the second
round, more pods from the first round have become ready. Basically, don't
scale by fixed chunks. Scaled based on how many are ready.

I'm pretty sure this is all clear to me now and seems workable.
Unfortunately, now we're back to...

How hard is that to implement?

The upstream code would need re-designed with this in mind. It would need
to take on the responsibility of checking overall readiness each interval
to recompute the scaling increment, or rely on the update acceptor to give
it new values (or context to inform the computation), or something else.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch from de165d8 to 2ff3b16 Compare July 21, 2015 15:34
@ironcladlou

Copy link
Copy Markdown
Contributor Author

@Kargakis

I drastically simplified the acceptor implementation based on your suggestion to use kapi.IsPodReady. PTAL.

@smarterclayton

Copy link
Copy Markdown
Contributor

"One failure breaks the deploy" which is incredibly fragile for any deployment over 5 or 10 pods. Follow? Probability of independent failures grows independently.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will check all pods every time right? Do we want that or we just want to check a pod once and then never check it again?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the latter, make this

if !c.acceptedPods.Has(pod) && kapi.IsPodReady(pod) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the latter. But you can't scale down if one of your new ones goes
down without breaching SLA.

On Jul 21, 2015, at 12:09 PM, Michail Kargakis [email protected]
wrote:

In pkg/deploy/strategy/support/lifecycle.go
#3701 (comment):

          continue
      }
  •     // The status of the container could be transient; we only care if it
    
  •     // was ever ready. If it was ready and then became not ready, we
    
  •     // consider it ready.
    
  •     if status.Ready {
    
  •         observedContainers[status.Name] = true
    
  •     }
    
  • }
    
  • // Check whether all containers have been observed as ready.
    
  • allReady := true
    
  • for _, ready := range observedContainers {
    
  •     if !ready {
    
  •         allReady = false
    
  •         break
    
  •     if kapi.IsPodReady(pod) {
    

If the latter, make this

if c.acceptedPods.Has(pod) && kapi.IsPodReady(pod) {

—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/3701/files#r35120393.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not equivalent. Still have to account for if the pod wasn't in accepted pods and is unready to insert it into the unready set. I don't think that would be any more clear or less code. It's already compact.

The current code doesn't perfom a readiness check on previously accepted pods.

I think the logic I have is correct.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I missed your check above

@ironcladlou

Copy link
Copy Markdown
Contributor Author

"One failure breaks the deploy" which is incredibly fragile for any deployment over 5 or 10 pods. Follow? Probability of independent failures grows independently.

Yes.

@smarterclayton

Copy link
Copy Markdown
Contributor

You and I can chat on that after we land this. I think this is LGTM but
need to take one more pass

On Jul 21, 2015, at 1:16 PM, Dan Mace [email protected] wrote:

"One failure breaks the deploy" which is incredibly fragile for any
deployment over 5 or 10 pods. Follow? Probability of independent failures
grows independently.

Yes.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch from 2ff3b16 to 20be192 Compare July 21, 2015 18:21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

godoc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done ;)

Integrate with upstream rolling update enhancements.

* Tweak the update acceptor to support being invoked on every update
  interval for a deployment.
* Update rolling params API to support updatePercent passed through
  to the upstream rolling updater.
@ironcladlou
ironcladlou force-pushed the rolling-updater-enhancements branch from 20be192 to 1e89ad0 Compare July 22, 2015 13:05
@smarterclayton

Copy link
Copy Markdown
Contributor

This is LGTM [merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/3707/) (Image: devenv-fedora_2045)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin up to 1e89ad0

openshift-bot pushed a commit that referenced this pull request Jul 22, 2015
@openshift-bot
openshift-bot merged commit 8b55191 into openshift:master Jul 22, 2015
@smarterclayton

Copy link
Copy Markdown
Contributor

Link the next issue here please

On Wed, Jul 22, 2015 at 1:44 PM, OpenShift Bot [email protected]
wrote:

Merged #3701 #3701.

—
Reply to this email directly or view it on GitHub
#3701 (comment).

Clayton Coleman | Lead Engineer, OpenShift

@ironcladlou

Copy link
Copy Markdown
Contributor Author

Created #3844 as a followup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants