Skip to content

updater: Check entire service spec when deciding whether to replace ongoing update#1497

Merged
aaronlehmann merged 1 commit intomoby:masterfrom
aaronlehmann:updater-check-service-changes
Sep 6, 2016
Merged

updater: Check entire service spec when deciding whether to replace ongoing update#1497
aaronlehmann merged 1 commit intomoby:masterfrom
aaronlehmann:updater-check-service-changes

Conversation

@aaronlehmann
Copy link
Copy Markdown
Collaborator

Currently, updater checks isServiceDirty to decide whether an existing
update should be restarted. This only checks the task spec and the
endpoint spec, so it will ignore changes to fields like UpdateConfig.
For example, it's not possible to change just the parallelism while an
update is already in progress. Fix this by comparing the whole spec.

cc @dongluochen @pnickolov


if update, ok := u.updates[id]; ok {
if !update.isServiceDirty(service) {
if reflect.DeepEqual(service.Spec, update.newService.Spec) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not modify isServiceDirty? This is the only place that method is called.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alternatively, if the better way to do things is the way it's done here, isServiceDirty is unused and should be removed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed isServiceDirty.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Sep 6, 2016

Current coverage is 55.49% (diff: 0.00%)

Merging #1497 into master will increase coverage by 0.09%

@@             master      #1497   diff @@
==========================================
  Files            82         82          
  Lines         12885      12882     -3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           7138       7149    +11   
+ Misses         4757       4750     -7   
+ Partials        990        983     -7   

Sunburst

Powered by Codecov. Last update 27fbaef...f2ba23b

…ngoing update

Currently, updater checks isServiceDirty to decide whether an existing
update should be restarted. This only checks the task spec and the
endpoint spec, so it will ignore changes to fields like UpdateConfig.
For example, it's not possible to change just the parallelism while an
update is already in progress. Fix this by comparing the whole spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@aaronlehmann aaronlehmann force-pushed the updater-check-service-changes branch from 8bda028 to f2ba23b Compare September 6, 2016 19:01
@dperny
Copy link
Copy Markdown
Collaborator

dperny commented Sep 6, 2016

LGTM

1 similar comment
@dongluochen
Copy link
Copy Markdown
Contributor

LGTM

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