open-nomad/nomad/state
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
..
autopilot.go goimports 2019-01-22 15:44:31 -08:00
autopilot_test.go implement MinQuorum 2020-02-16 16:04:59 -06:00
iterator.go csi: use node MaxVolumes during scheduling (#7565) 2020-03-31 17:16:47 -04:00
schema.go scaling api: more testing around the scaling events api 2020-04-01 16:39:23 +00:00
schema_test.go nomad: ensure a unique ClusterID exists when leader (gh-6702) 2020-01-31 19:03:26 -06:00
state_store.go Handle nil/empty cluster metadata 2020-05-29 13:34:21 -04:00
state_store_oss.go include pro tag in serveral oss.go files 2020-02-10 15:56:14 -05:00
state_store_test.go csi: fix plugin counts on node update (#7844) 2020-05-05 15:39:57 -04:00
testing.go csi: plugin deregistration on plugin job GC (#7502) 2020-03-26 17:07:18 -04:00
testing_oss.go removes pro tags (#8014) 2020-05-28 15:40:17 -04:00