open-nomad/nomad
hc-github-team-nomad-core 90cb544835
scheduler: ensure dup alloc names are fixed before plan submit. (#18873) (#18891)
This change fixes a bug within the generic scheduler which meant
duplicate alloc indexes (names) could be submitted to the plan
applier and written to state. The bug originates from the
placements calculation notion that names of allocations being
replaced are blindly copied to their replacement. This is not
correct in all cases, particularly when dealing with canaries.

The fix updates the alloc name index tracker to include minor
duplicate tracking. This can be used when computing placements to
ensure duplicate are found, and a new name picked before the plan
is submitted. The name index tracking is now passed from the
reconciler to the generic scheduler via the results, so this does
not have to be regenerated, or another data structure used.

Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
2023-10-27 17:04:04 +01:00
..
deploymentwatcher deploymentwatcher: fail early whenever possible (#17341) 2023-06-26 14:01:03 -04:00
drainer update go1.21 (#18184) 2023-08-15 14:40:33 +02:00
mock Backport of feature: Add new field render_templates on restart block into release/1.6.x (#18094) 2023-07-28 13:54:00 -05:00
state backport of commit 9b74e11f064ecc53a53f13e82419927b533a9e4a (#18589) 2023-09-26 15:23:35 -05:00
stream node pools: add event stream support (#17412) 2023-06-06 10:14:47 -04:00
structs scheduler: ensure dup alloc names are fixed before plan submit. (#18873) (#18891) 2023-10-27 17:04:04 +01:00
volumewatcher api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
acl.go client: send node secret with every client-to-server RPC (#16799) 2023-06-22 11:06:49 -04:00
acl_endpoint.go refactor acl.UpsertTokens to avoid unnecessary RPC calls. (#17194) 2023-05-16 09:31:51 +02:00
acl_endpoint_test.go test: use correct parallel test setup func (#18326) (#18330) 2023-08-25 14:48:06 +01:00
acl_test.go cli: tls certs not created with correct SANs (#16959) 2023-05-22 09:31:56 -04:00
alloc_endpoint.go client: prevent using stale allocs (#18601) 2023-09-29 14:34:04 -07:00
alloc_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
autopilot.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
autopilot_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
autopilot_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
blocked_evals.go backport of commit b46b41a2e99ad85d18189b44836f6436a2149a8b (#18855) 2023-10-24 11:51:04 -05:00
blocked_evals_stats.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
blocked_evals_stats_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
blocked_evals_system.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
blocked_evals_test.go backport of commit b46b41a2e99ad85d18189b44836f6436a2149a8b (#18855) 2023-10-24 11:51:04 -05:00
client_agent_endpoint.go backport of commit ca9e08e6b5eee00d055b9429df5976a70cdcb2d6 (#18813) 2023-10-20 08:35:54 +01:00
client_agent_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
client_alloc_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
client_alloc_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
client_csi_endpoint.go backport of commit 4895d708b438b42e52fd54a128f9ec4cb6d72277 (#18531) 2023-09-18 14:29:29 -05:00
client_csi_endpoint_test.go backport of commit 4895d708b438b42e52fd54a128f9ec4cb6d72277 (#18531) 2023-09-18 14:29:29 -05:00
client_fs_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
client_fs_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
client_meta_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
client_meta_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
client_rpc.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
client_rpc_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
client_stats_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
client_stats_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
config.go Backport of Tuning job versions retention. #17635 into release/1.6.x (#18169) 2023-08-07 13:48:09 -05:00
consul.go consul: handle "not found" errors from Consul when deleting tokens (#17847) 2023-07-07 16:22:13 -04:00
consul_oss_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_policy.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_policy_oss_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_policy_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
core_sched.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
core_sched_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
csi_endpoint.go backport of commit 4895d708b438b42e52fd54a128f9ec4cb6d72277 (#18531) 2023-09-18 14:29:29 -05:00
csi_endpoint_test.go backport of commit 4895d708b438b42e52fd54a128f9ec4cb6d72277 (#18531) 2023-09-18 14:29:29 -05:00
deployment_endpoint.go Deployment Status Command Does Not Respect -namespace Wildcard (#16792) 2023-04-12 11:02:14 +02:00
deployment_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
deployment_watcher_shims.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
drainer_int_test.go test: deflake node drain intergration test (#18171) 2023-08-14 16:19:00 -04:00
drainer_shims.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
encrypter.go Only generate default workload identity once per alloc task - 1.6.x (#18783) 2023-10-17 13:06:20 -05:00
encrypter_test.go Only generate default workload identity once per alloc task - 1.6.x (#18783) 2023-10-17 13:06:20 -05:00
endpoints_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
eval_broker.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
eval_broker_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
eval_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
eval_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
event_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
event_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
fsm.go backport of commit c28cd59655b88d64f841bed5da7996ae8d88772f (#18411) 2023-09-06 11:32:42 -05:00
fsm_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
fsm_registry_oss.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
fsm_test.go Backport of Tuning job versions retention. #17635 into release/1.6.x (#18169) 2023-08-07 13:48:09 -05:00
heartbeat.go backport: do not embed *Server (#18786) (#18789) 2023-10-17 15:55:56 -05:00
heartbeat_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
job_endpoint.go backport of commit e7136f80c5c1277ea2dea4eeeda84005224d7835 (#18648) 2023-10-03 12:27:26 -05:00
job_endpoint_hook_connect.go connect: use heuristic to detect sidecar task driver (#17065) 2023-05-05 10:19:30 -05:00
job_endpoint_hook_connect_test.go connect: use heuristic to detect sidecar task driver (#17065) 2023-05-05 10:19:30 -05:00
job_endpoint_hook_expose_check.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
job_endpoint_hook_expose_check_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
job_endpoint_hook_node_pool.go node pools: validate pool exists on job registration (#17386) 2023-06-02 09:32:07 -04:00
job_endpoint_hook_node_pool_oss.go node pools: namespace integration (#17562) 2023-06-16 16:30:22 -04:00
job_endpoint_hook_vault.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
job_endpoint_hook_vault_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
job_endpoint_hooks.go node pools: apply node pool scheduler configuration (#17598) 2023-06-21 20:31:50 -04:00
job_endpoint_hooks_test.go node pools: namespace integration (#17562) 2023-06-16 16:30:22 -04:00
job_endpoint_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
job_endpoint_oss_test.go node pools: namespace integration (#17562) 2023-06-16 16:30:22 -04:00
job_endpoint_test.go test: deflake job endpoint registration test (#18170) 2023-08-14 16:18:53 -04:00
job_endpoint_validators.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
job_endpoint_validators_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
keyring_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
keyring_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
leader.go node pools: replicate from authoritative region (#17456) 2023-06-12 13:24:24 -04:00
leader_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
leader_test.go node pools: replicate from authoritative region (#17456) 2023-06-12 13:24:24 -04:00
license_config.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
license_config_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
merge.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
namespace_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
namespace_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
node_endpoint.go backport of commit 776a26bce7cf3a320fc7e7f4a6bf9da2b30f3da7 (#18375) 2023-09-01 10:25:08 +01:00
node_endpoint_test.go test: use correct parallel test setup func (#18326) (#18330) 2023-08-25 14:48:06 +01:00
node_pool_endpoint.go update go1.21 (#18184) 2023-08-15 14:40:33 +02:00
node_pool_endpoint_oss.go np: check for license on RPC endpoints (#17656) 2023-06-22 12:52:20 -04:00
node_pool_endpoint_test.go np: fix list of jobs for node pool `all` (#17705) 2023-06-23 15:47:53 -04:00
operator_endpoint.go backport of commit 776a26bce7cf3a320fc7e7f4a6bf9da2b30f3da7 (#18375) 2023-09-01 10:25:08 +01:00
operator_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
periodic.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
periodic_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
periodic_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
periodic_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
plan_apply.go backport: do not embed *Server (#18786) (#18789) 2023-10-17 15:55:56 -05:00
plan_apply_node_tracker.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plan_apply_node_tracker_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plan_apply_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plan_apply_pool.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plan_apply_pool_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plan_apply_test.go Only generate default workload identity once per alloc task - 1.6.x (#18783) 2023-10-17 13:06:20 -05:00
plan_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plan_endpoint_test.go test: use correct parallel test setup func (#18326) (#18330) 2023-08-25 14:48:06 +01:00
plan_normalization_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
plan_queue.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plan_queue_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
raft_rpc.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
regions_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
regions_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
rpc.go backport: do not embed *Server (#18786) (#18789) 2023-10-17 15:55:56 -05:00
rpc_rate_metrics.go core: ensure all Server receiver names are consistent. (#16859) 2023-04-12 14:03:07 +01:00
rpc_test.go backport of commit 65501ff97aa2ec6fa3c4f53d3f8c6c80c6a0e8a3 (#18166) 2023-08-07 10:17:34 -05:00
scaling_endpoint.go update go1.21 (#18184) 2023-08-15 14:40:33 +02:00
scaling_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
search_endpoint.go search: fix ACL filtering for plugins and variables 2023-07-18 12:09:55 -04:00
search_endpoint_oss.go search: fix ACL filtering for plugins and variables 2023-07-18 12:09:55 -04:00
search_endpoint_test.go search: fix ACL filtering for plugins and variables 2023-07-18 12:09:55 -04:00
serf.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
serf_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
server.go backport of commit 1339599185af9dbfcca6f0aa1001c6753b8c682b (#18517) 2023-09-15 09:16:38 -04:00
server_setup_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
server_test.go cli: tls certs not created with correct SANs (#16959) 2023-05-22 09:31:56 -04:00
service_registration_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
service_registration_endpoint_test.go Only generate default workload identity once per alloc task - 1.6.x (#18783) 2023-10-17 13:06:20 -05:00
stats_fetcher.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
stats_fetcher_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
status_endpoint.go backport of commit 776a26bce7cf3a320fc7e7f4a6bf9da2b30f3da7 (#18375) 2023-09-01 10:25:08 +01:00
status_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
system_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
system_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
testing.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
testing_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
timetable.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
timetable_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
util.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
util_test.go test: use correct parallel test setup func (#18326) (#18330) 2023-08-25 14:48:06 +01:00
variables_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
variables_endpoint_test.go allow periodic jobs to use workload identity ACL policies (#17018) 2023-05-22 09:19:16 -04:00
vault.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
vault_test.go vault: use an importable const for Vault header string. (#18740) (#18750) 2023-10-13 08:11:54 +01:00
vault_testing.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
worker.go backport of commit e8efe2d251bf3628f13c7eb3ce2422eb7e5b85f6 (#18884) 2023-10-27 17:20:53 +02:00
worker_string_schedulerworkerstatus.go Make number of scheduler workers reloadable (#11593) 2022-01-06 11:56:13 -05:00
worker_string_workerstatus.go Make number of scheduler workers reloadable (#11593) 2022-01-06 11:56:13 -05:00
worker_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00