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

Add separate rollback parameters #1878

Merged
merged 1 commit into from
Feb 11, 2017

Conversation

aaronlehmann
Copy link
Collaborator

@aaronlehmann aaronlehmann commented Jan 18, 2017

Rather than reusing the values Spec.Update during a the rollback of an
update, use parameters from a separate Spec.Rollback UpdateConfig. This
allows configurations such as a rolling, gradual update, and a fast
parallel rollback to the original version if things go wrong.

If no Rollback message is provided, defaults will apply.

This also adds a Rollback flag to UpdateServiceRequest so that manually
triggered rollbacks (which are currently client-side operations) can be
initiated server-side, and have the correct update settings applied. We
also need to make sure not to trigger an automatic rollback from a
failed manual rollback.

@aaronlehmann
Copy link
Collaborator Author

cc @aluzzardi @dongluochen

@dongluochen
Copy link
Contributor

need to make sure not to trigger an automatic rollback from a failed manual rollback.

We may use a forced flag to define a unidirectional rollout, which would not be rollback. It not only covers rollback case, it also allows users push an update, ignoring failures.

@codecov-io
Copy link

codecov-io commented Jan 18, 2017

Codecov Report

Merging #1878 into master will increase coverage by 0.16%.

@@            Coverage Diff             @@
##           master    #1878      +/-   ##
==========================================
+ Coverage   54.01%   54.18%   +0.16%     
==========================================
  Files         108      108              
  Lines       18535    18552      +17     
==========================================
+ Hits        10012    10052      +40     
+ Misses       7303     7273      -30     
- Partials     1220     1227       +7

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 bf90af2...c37c646. Read the comment docs.

flags.String("update-on-failure", "pause", "action on failure during update (pause|continue)")
flags.String("update-on-failure", "pause", "action on failure during update (pause|continue|rollback)")

flags.Uint64("rollback-parallelism", 0, "task update parallelism during rollback (0 = all at once)")
Copy link
Contributor

Choose a reason for hiding this comment

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

This default doesn't sound right. It'd interrupt service. Same with update-parallelism. How about changing default to 2 halves?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this should have the same default as update-parallelism. I know that in Docker update-parallelism defaults to 1. We should probably fix it to do the same here. It's not really easy though - under our current system, the only way to do that is to hardcode those defaults in the client. I have a proposal for doing this better in #1744.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think #1744 is a good idea.

if err != nil {
return err
}
if spec.Rollback == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since there are default values, I'd suggest always create spec.Rollback.

@aaronlehmann
Copy link
Collaborator Author

@aluzzardi: I've updated this to have a Rollback enum in UpdateServiceRequest that can allow a manual rollback to be triggered on the server side.

@dongluochen
Copy link
Contributor

Design looks good to me. Please rebase.

@aaronlehmann
Copy link
Collaborator Author

Thanks. Rebased.

@aaronlehmann
Copy link
Collaborator Author

Rebased again.

Review ping

Rather than reusing the values Spec.Update during a the rollback of an
update, use parameters from a separate Spec.Rollback UpdateConfig. This
allows configurations such as a rolling, gradual update, and a fast
parallel rollback to the original version if things go wrong.

If no Rollback message is provided, defaults will apply.

This also adds a Rollback flag to UpdateServiceRequest so that manually
triggered rollbacks (which are currently client-side operations) can be
initiated server-side, and have the correct update settings applied.  We
also need to make sure not to trigger an automatic rollback from a
failed manual rollback.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@aaronlehmann aaronlehmann force-pushed the rollback-parameters branch 2 times, most recently from c1ae7e1 to c37c646 Compare February 8, 2017 16:52
@dongluochen
Copy link
Contributor

LGTM

1 similar comment
@aluzzardi
Copy link
Member

LGTM

@aluzzardi aluzzardi merged commit 9b1e983 into moby:master Feb 11, 2017
@aaronlehmann aaronlehmann deleted the rollback-parameters branch February 11, 2017 02:08
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.

4 participants