From c497baf9194f5c6267c7130e77ccf09fd759add8 Mon Sep 17 00:00:00 2001 From: Drew Bailey <2614075+drewbailey@users.noreply.github.com> Date: Mon, 10 Feb 2020 16:26:00 -0500 Subject: [PATCH] Reverts #6703 This PR reverts changes introduced in #6703 that made changes to affinities and spreads cause destructive updates. https://github.com/hashicorp/nomad/issues/6988 outlines good reason to rethink this until we have scheduler functionality in place that treats and update to spread/affinity similar to how count changes are handled (rebalancing the difference instead of rescheduling all allocs). --- scheduler/util.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scheduler/util.go b/scheduler/util.go index d93b0e5037b6..c4d590a4d5ce 100644 --- a/scheduler/util.go +++ b/scheduler/util.go @@ -367,15 +367,10 @@ func tasksUpdated(jobA, jobB *structs.Job, taskGroup string) bool { return true } + // TODO: check affinities and spreads + // for tasks updated, but do not necessarily + // reschedule or re-create them. // Check Affinities - if affinitiesUpdated(jobA, jobB, taskGroup) { - return true - } - - // Check Spreads - if spreadsUpdated(jobA, jobB, taskGroup) { - return true - } // Check each task for _, at := range a.Tasks {