open-nomad/nomad/structs
Luiz Aoqui 8f91be26ab
scheduler: create placements for non-register MRD (#15325)
* scheduler: create placements for non-register MRD

For multiregion jobs, the scheduler does not create placements on
registration because the deployment must wait for the other regions.
Once of these regions will then trigger the deployment to run.

Currently, this is done in the scheduler by considering any eval for a
multiregion job as "paused" since it's expected that another region will
eventually unpause it.

This becomes a problem where evals not triggered by a job registration
happen, such as on a node update. These types of regional changes do not
have other regions waiting to progress the deployment, and so they were
never resulting in placements.

The fix is to create a deployment at job registration time. This
additional piece of state allows the scheduler to differentiate between
a multiregion change, where there are other regions engaged in the
deployment so no placements are required, from a regional change, where
the scheduler does need to create placements.

This deployment starts in the new "initializing" status to signal to the
scheduler that it needs to compute the initial deployment state. The
multiregion deployment will wait until this deployment state is
persisted and its starts is set to "pending". Without this state
transition it's possible to hit a race condition where the plan applier
and the deployment watcher may step of each other and overwrite their
changes.

* changelog: add entry for #15325
2022-11-25 12:45:34 -05:00
..
config cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
acl.go acl: sso auth method RPC endpoints (#15221) 2022-11-21 10:15:39 +01:00
acl_test.go acl: sso auth method RPC endpoints (#15221) 2022-11-21 10:15:39 +01:00
alloc.go
alloc_test.go
autopilot.go
batch_future.go
batch_future_test.go
bitmap.go
bitmap_test.go
check_test.go
checks.go
connect.go
connect_test.go
consul.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
consul_oss.go
consul_oss_test.go
consul_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
csi.go
csi_test.go
devices.go
devices_test.go
diff.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
diff_test.go template: error on missing key (#15141) 2022-11-04 13:23:01 -04:00
encoding.go
errors.go
errors_test.go
eval.go eval delete: move batching of deletes into RPC handler and state (#15117) 2022-11-14 14:08:13 -05:00
event.go acl: sso auth method event stream (#15280) 2022-11-21 10:06:05 +01:00
extensions.go
funcs.go
funcs_test.go
generate.sh
handlers.go
job.go servicedisco: implicit constraint for nomad v1.4 when using nsd checks (#14868) 2022-10-11 08:21:42 -05:00
job_test.go servicedisco: implicit constraint for nomad v1.4 when using nsd checks (#14868) 2022-10-11 08:21:42 -05:00
keyring.go keyring: safely handle missing keys and restore GC (#15092) 2022-11-01 15:00:50 -04:00
network.go
network_test.go
node.go
node_class.go
node_class_test.go
node_test.go
operator.go
search.go
service_identities.go
service_registration.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
service_registration_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
services.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
services_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
streaming_rpc.go
structs.go scheduler: create placements for non-register MRD (#15325) 2022-11-25 12:45:34 -05:00
structs_codegen.go
structs_oss.go
structs_periodic_test.go
structs_test.go acl: sso auth method RPC endpoints (#15221) 2022-11-21 10:15:39 +01:00
testing.go
uuid.go
variables.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
variables_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
vault.go
volume_test.go
volumes.go