mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
When a job is purged, we delete all its allocations and the client detects the absense of the allocations to clean up its resources locally. But the client won't be able to send an allocation status update in this case, which frees the quota being used by that allocation. Instead, we need to free the quota usage inside the state store immediately. To do so, we check if the allocation is already client-terminal before copying it and passing it into the Enterprise code for cleanup. This commit also refactors the job delete to make it clear there's a single caller of this alloc deletion path. This refactoring eliminates some wasteful logic that queries the "allocs" table, allocates a slice of strings for their IDs, and then queries the "allocs" table one-by-one for each of them for deletion anyways. Tests for this code can be found in the linked ENT repo PR. Fixes: https://github.com/hashicorp/nomad-enterprise/issues/1422 Ref: https://hashicorp.atlassian.net/browse/NOMAD-620 Ref: https://github.com/hashicorp/nomad-enterprise/pull/1432
4 lines
113 B
Plaintext
4 lines
113 B
Plaintext
```release-note:bug
|
|
quota (Enterprise): Fixed a bug where quota usage would not be freed if a job was purged
|
|
```
|