hashicorp / hashicorp/nomad

reconciler: Stopping allocs by name is error prone

Open
#12,797 1 comment 0 reactions 0 assignees View on GitHub
theme/core theme/scheduling type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal

The reconciler relies on the allocation name (task name + index) when deciding which allocs to stop. This is a non-deterministic value that has led to numerous defects over time. While the name is useful for identifying allocations that conflict, by itself, it is not enough to know which allocation to keep and which to discard. We should design a more resilient approach to reconciling allocations that have the same name.

### Use-cases

This issue was identified during work on [PR12795](https://github.com/hashicorp/nomad/pull/12795). During code review, it came to light that this has been a source of historical problems and that we should look for an alternate approach.

### Attempted Solutions

So far, all effort has been expended around ensuring that the surrounding code ensures allocs are filtered correctly into specific sets and then managing those sets. This approach, compounded by change over time, has led to sprawling logic spread across numerous functions that creates a significant cognitive load when trying to work on this aspect of the scheduler.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading PR12795 and tracing the reconciler logic that decides which allocations with the same name to keep or stop. Review the surrounding filtering and set-management functions described in the issue. Done means a resilient, well-defined reconciliation approach replaces reliance on allocation names alone.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.