From 3701ee09c880b9a54568702964ee2a0707060b6d Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Fri, 27 Apr 2018 16:54:51 -0700 Subject: [PATCH] Fix the initial progress deadline calculation when the alloc is inplace updated to be part of a new deployment --- nomad/state/state_store.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index a47c9af59..d46d156c4 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -3340,9 +3340,11 @@ func (s *StateStore) updateDeploymentWithAlloc(index uint64, alloc, existing *st // Update the progress deadline if pd := state.ProgressDeadline; pd != 0 { - // If we are the first placed allocation start the progress deadline. + // If we are the first placed allocation for the deployment start the progress deadline. if placed != 0 && state.RequireProgressBy.IsZero() { - state.RequireProgressBy = time.Unix(0, alloc.CreateTime).Add(pd) + // Use modify time instead of create time becasue we may in-place + // update the allocation to be part of a new deployment. + state.RequireProgressBy = time.Unix(0, alloc.ModifyTime).Add(pd) } else if healthy != 0 { if d := alloc.DeploymentStatus.Timestamp.Add(pd); d.After(state.RequireProgressBy) { state.RequireProgressBy = d