mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Fix the initial progress deadline calculation when the alloc is inplace updated to be part of a new deployment
This commit is contained in:
committed by
Preetha Appan
parent
801d147e83
commit
3701ee09c8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user