open-nomad/nomad
Mahmood Ali 37c6160b96 Handle nil/empty cluster metadata
Handle case where a snapshot is made before cluster metadata is created.

This fixes a bug where a server may have empty cluster metadata if it
created and installed a Raft snapshot before a new cluster metadata ID is
generated.

This case is very unlikely to arise.  Most likely reason is when
upgrading from an old version slowly where servers may use snapshots
before all servers upgrade.  This happened for a user with a log line
like:

```
2020-05-21T15:21:56.996Z [ERROR] nomad.fsm: ClusterSetMetadata failed: error=""set cluster metadata failed: refusing to set new cluster id, previous: , new: <<redacted>
```
2020-05-29 13:34:21 -04:00
..
deploymentwatcher {volume|deployment}watcher: check for nil batcher 2020-05-26 14:54:27 -04:00
drainer avoid logging in draining job watcher 2020-03-30 07:06:53 -04:00
mock csi: support for VolumeContext and VolumeParameters (#7957) 2020-05-15 08:16:01 -04:00
state Handle nil/empty cluster metadata 2020-05-29 13:34:21 -04:00
structs Oss license support for ent builds (#8054) 2020-05-27 13:46:52 -04:00
types
volumewatcher {volume|deployment}watcher: check for nil batcher 2020-05-26 14:54:27 -04:00
acl.go Audit config, seams for enterprise audit features 2020-03-23 13:47:42 -04:00
acl_endpoint.go
acl_endpoint_test.go
acl_test.go Audit config, seams for enterprise audit features 2020-03-23 13:47:42 -04:00
alloc_endpoint.go
alloc_endpoint_test.go
autopilot.go
autopilot_test.go tests: deflake TestAutopilot_RollingUpdate 2020-04-03 17:15:41 -04:00
blocked_evals.go
blocked_evals_system.go
blocked_evals_test.go
client_agent_endpoint.go vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:45:21 -04:00
client_agent_endpoint_test.go avoid logging after a test completes 2020-05-09 14:40:00 -04:00
client_alloc_endpoint.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
client_alloc_endpoint_test.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
client_csi_endpoint.go fix a trace logline 2020-05-26 10:18:09 -04:00
client_csi_endpoint_test.go tests: wait until clients are in the state store 2020-05-26 18:53:24 -04:00
client_fs_endpoint.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
client_fs_endpoint_test.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
client_rpc.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
client_rpc_test.go
client_stats_endpoint.go
client_stats_endpoint_test.go
config.go Oss license support for ent builds (#8054) 2020-05-27 13:46:52 -04:00
consul.go consul/connect: use task kind to get service name 2020-05-18 13:46:00 -06:00
consul_policy.go
consul_policy_test.go
consul_test.go consul/connect: use task kind to get service name 2020-05-18 13:46:00 -06:00
core_sched.go Periodic GC for volume claims (#7881) 2020-05-11 08:20:50 -04:00
core_sched_test.go Periodic GC for volume claims (#7881) 2020-05-11 08:20:50 -04:00
csi_batch.go csi: don't pass volume claim releases thru GC eval (#8021) 2020-05-20 15:22:51 -04:00
csi_batch_test.go csi: don't pass volume claim releases thru GC eval (#8021) 2020-05-20 15:22:51 -04:00
csi_endpoint.go csi: check for empty arguments on CSI endpoint (#8027) 2020-05-20 10:22:24 -04:00
csi_endpoint_test.go csi: support Secrets parameter in CSI RPCs (#7923) 2020-05-11 17:12:51 -04:00
deployment_endpoint.go
deployment_endpoint_test.go
deployment_watcher_shims.go
drainer_int_test.go tests: use GreaterOrEqual and apply change to other tests 2020-05-27 11:22:48 -04:00
drainer_shims.go
endpoints_oss.go
eval_broker.go
eval_broker_test.go
eval_endpoint.go
eval_endpoint_test.go
fsm.go Handle nil/empty cluster metadata 2020-05-29 13:34:21 -04:00
fsm_not_ent.go
fsm_registry_oss.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
fsm_test.go handle upgrade path and defaults 2020-05-09 12:34:08 -04:00
heartbeat.go
heartbeat_test.go
job_endpoint.go csi: don't pass volume claim releases thru GC eval (#8021) 2020-05-20 15:22:51 -04:00
job_endpoint_hook_connect.go consul/connect: use task kind to get service name 2020-05-18 13:46:00 -06:00
job_endpoint_hook_connect_test.go
job_endpoint_hook_expose_check.go nomad: build dynamic port for exposed checks if not specified (#7800) 2020-04-28 00:07:41 -04:00
job_endpoint_hook_expose_check_test.go nomad: build dynamic port for exposed checks if not specified (#7800) 2020-04-28 00:07:41 -04:00
job_endpoint_hooks.go
job_endpoint_oss.go
job_endpoint_test.go api: validate scale count value is not negative. 2020-05-08 16:51:40 +02:00
leader.go terminate leader goroutines on shutdown 2020-05-26 10:18:10 -04:00
leader_oss.go
leader_test.go
merge.go
node_endpoint.go Oss license support for ent builds (#8054) 2020-05-27 13:46:52 -04:00
node_endpoint_test.go tests: use t.Fatalf when it's clearer 2020-05-27 10:09:56 -04:00
operator_endpoint.go
operator_endpoint_test.go
periodic.go
periodic_endpoint.go
periodic_endpoint_test.go csi: fix index maintenance for CSIVolume and CSIPlugin tables (#7049) 2020-03-23 13:58:29 -04:00
periodic_test.go Update current DST and some code style issues 2020-05-07 19:27:05 -04:00
plan_apply.go
plan_apply_not_ent.go
plan_apply_pool.go
plan_apply_pool_test.go
plan_apply_test.go
plan_endpoint.go
plan_endpoint_test.go
plan_normalization_test.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
plan_queue.go
plan_queue_test.go
raft_rpc.go
regions_endpoint.go
regions_endpoint_test.go
rpc.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
rpc_test.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
scaling_endpoint.go add acl validation to Scaling.ListPolicies and Scaling.GetPolicy 2020-03-24 14:39:05 +00:00
scaling_endpoint_test.go update RPC scaling endpoint tests to use renamed 'scale' policy disposition 2020-03-24 20:18:12 +00:00
search_endpoint.go csi: CLI for volume status, registration/deregistration and plugin status (#7193) 2020-03-23 13:58:30 -04:00
search_endpoint_oss.go csi: implement volume ACLs (#7339) 2020-03-23 13:59:25 -04:00
search_endpoint_test.go csi: plugin deregistration on plugin job GC (#7502) 2020-03-26 17:07:18 -04:00
serf.go
serf_test.go
server.go csi: move volume claim release into volumewatcher (#7794) 2020-04-30 09:13:00 -04:00
server_setup_oss.go removes pro tags (#8014) 2020-05-28 15:40:17 -04:00
server_test.go
stats_fetcher.go
stats_fetcher_test.go
status_endpoint.go
status_endpoint_test.go
system_endpoint.go
system_endpoint_test.go
testing.go csi: plugin deregistration on plugin job GC (#7502) 2020-03-26 17:07:18 -04:00
timetable.go vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:45:21 -04:00
timetable_test.go fixup! vendor: explicit use of hashicorp/go-msgpack 2020-03-31 09:48:07 -04:00
util.go
util_test.go
vault.go vault: ensure that token revocation is idempotent 2020-05-14 11:30:32 -04:00
vault_test.go vault: failing test for repeated revocation 2020-05-14 11:30:29 -04:00
vault_testing.go
volumewatcher_shim.go csi: move volume claim release into volumewatcher (#7794) 2020-04-30 09:13:00 -04:00
worker.go
worker_test.go