Rolling update not working - max_parallel
Nomad version
0.7.1
Operating system and Environment details
Ubuntu 16.10
Issue
Rolling update doesn't work as expected. I am using the following documentation https://goo.gl/2vSuhq and it says :
Thus when a change is made to the job file that requires new allocations to be made, Nomad will deploy 2 allocations at a time and require that the allocations be running in a healthy state for 30 seconds before deploying more versions of the new group.
I tried to use its rolling update but one of my nodes just doesn't update at any time soon.
If I changed it to max_parallel = 2 it will update both node, but wouldn't it be better and right to use max_parallel = 1 and get one deploy of allocations at a time.
Why is it unhealthy? as I mentioned if i use max parallel = 2 it will deploy to both servers.
Latest Deployment ID = 4f13fece Status = failed Description = Failed due to unhealthy allocations
Just one is updated and the other still running as the old version :
Allocations ID Node ID Task Group Version Desired Status Created Modified 652eb2fe 8d025416 aplicacao 71 run running 1m ago 54s ago e30766bc 8d025416 aplicacao 70 stop complete 29m18s ago 54s ago f052dbce 8d025416 aplicacao 69 stop complete 34m35s ago 29m13s ago 56f4e1f9 8d025416 aplicacao 68 stop complete 45m26s ago 34m29s ago 57b7884f 8d025416 aplicacao 67 stop complete 47m53s ago 45m20s ago 9f01829f 8d025416 aplicacao 66 stop complete 48m44s ago 47m48s ago edcc61e3 87016ac2 aplicacao 68 run running 48m44s ago 42m26s ago 12a6468f 8d025416 aplicacao 65 stop complete 53m58s ago 48m39s ago 001f89ee 87016ac2 aplicacao 64 stop complete 1h9m ago 48m38s ago acf6a627 8d025416 aplicacao 64 stop complete 1h9m ago 53m53s ago
Reproduction steps
Changed the job spec and checked to see if it was going to wait 30s before update the second server.
Nomad Server logs (if appropriate)
Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.759898 [DEBUG] worker: ack for evaluation ee609e37-e081-b9cc-c191-d92ddd570c95 Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.760373 [DEBUG] worker: dequeued evaluation cd61d9a5-98b8-1f66-4459-7b4ca86db9f7 Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.760821 [DEBUG] sched.core: node GC: scanning before index 13664 (24h0m0s) Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.761226 [DEBUG] worker: ack for evaluation cd61d9a5-98b8-1f66-4459-7b4ca86db9f7 Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.761769 [DEBUG] worker: dequeued evaluation da7e55cd-c49b-3c4b-b6eb-a2adc659244b Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.762213 [DEBUG] sched.core: job GC: scanning before index 17903 (4h0m0s) Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.762642 [DEBUG] worker: ack for evaluation da7e55cd-c49b-3c4b-b6eb-a2adc659244b Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.763121 [DEBUG] worker: dequeued evaluation 0259b7da-0192-5c71-2c08-649ea33e7038 Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.763532 [DEBUG] sched.core: deployment GC: scanning before index 18305 (1h0m0s) Nov 20 19:05:18 runner1 nomad[5982]: 2017/11/20 19:05:18.763983 [DEBUG] worker: ack for evaluation 0259b7da-0192-5c71-2c08-649ea33e7038
Nomad Client logs (if appropriate)
ov 20 17:01:38 bro5 nomad[8716]: 2017/11/20 17:01:38.254396 [DEBUG] http: Request /v1/job/pontoweb/allocations?all=false (85.8053ms) Nov 20 17:01:38 bro5 nomad[8716]: 2017/11/20 17:01:38.302432 [DEBUG] http: Request /v1/job/pontoweb/evaluations (43.820112ms) Nov 20 17:01:38 bro5 nomad[8716]: 2017/11/20 17:01:38.346579 [DEBUG] http: Request /v1/job/pontoweb/deployment (42.019705ms) Nov 20 17:01:38 bro5 nomad[8716]: 2017/11/20 17:01:38.390303 [DEBUG] http: Request /v1/job/pontoweb/summary (42.471121ms) Nov 20 17:03:22 bro5 nomad[8716]: 2017/11/20 17:03:22.329958 [DEBUG] client: updated allocations at index 18619 (total 11) (pulled 1) (filtered 10) Nov 20 17:03:22 bro5 nomad[8716]: 2017/11/20 17:03:22.330136 [DEBUG] client: allocs: (added 0) (removed 0) (updated 1) (ignore 10) Nov 20 17:03:22 bro5 nomad[8716]: 2017/11/20 17:03:22.330436 [DEBUG] client: dropping update to terminal alloc '929aab3d-742f-121e-89fa-2b3cad6588ec' Nov 20 17:08:22 bro5 nomad[8716]: 2017/11/20 17:08:22.632163 [DEBUG] client: updated allocations at index 18619 (total 11) (pulled 1) (filtered 10)
Job file (if appropriate)
job "pontoweb" { datacenters = ["bro5", "bro7"] type = "service" update { max_parallel = 1 min_healthy_time = "30s" healthy_deadline = "3m" auto_revert = true canary = 0 } group "aplicacao" { count = 2 constraint { operator = "distinct_hosts" value = "true" } restart { attempts = 10 interval = "1h" delay = "25s" mode = "delay" }
....
Hey I would do your update and then if it fails do nomad alloc-status on the new allocation and it will tell you why it failed. If you have a failed allocation as part of the deployment it will not continue the deployment. So this appears to be expected behavior.
@dadgar
When it fails I do have its id to run nomad alloc-status against to, but in this case it looks like it just deployed one version and left one of the node on a behind version.
And maybe it indeed fail, but it was not due to my application once I remove the auto_revert or increase the max_parallel to 2 it will deploy normally.
Did you understand?
It just doesn't deploy when using max_parallel lower than the desired count.
@weslleycamilo I am sorry I don't actually follow. Would you mind coming up with a simple job specification and steps to reproduce with a clear indication of the problem?
When you have max_parallel = 1 only one will be updated at a time and if that newly placed allocation fails the remaining ones will not be updated. That is by design to prevent rolling out a bad job version.
I am going to close in the meantime since I have played with it quite a bit and haven't been able to have it not place properly.
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.