open-nomad/nomad/structs
Tim Gross 903b5baaa4
keyring: safely handle missing keys and restore GC (#15092)
When replication of a single key fails, the replication loop breaks early and
therefore keys that fall later in the sorting order will never get
replicated. This is particularly a problem for clusters impacted by the bug that
caused #14981 and that were later upgraded; the keys that were never replicated
can now never be replicated, and so we need to handle them safely.

Included in the replication fix:
* Refactor the replication loop so that each key replicated in a function call
  that returns an error, to make the workflow more clear and reduce nesting. Log
  the error and continue.
* Improve stability of keyring replication tests. We no longer block leadership
  on initializing the keyring, so there's a race condition in the keyring tests
  where we can test for the existence of the root key before the keyring has
  been initialize. Change this to an "eventually" test.

But these fixes aren't enough to fix #14981 because they'll end up seeing an
error once a second complaining about the missing key, so we also need to fix
keyring GC so the keys can be removed from the state store. Now we'll store the
key ID used to sign a workload identity in the Allocation, and we'll index the
Allocation table on that so we can track whether any live Allocation was signed
with a particular key ID.
2022-11-01 15:00:50 -04:00
..
config cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
acl.go acl: add ACL roles to event stream topic and resolve policies. (#14923) 2022-10-20 09:43:35 +02:00
acl_test.go acl: add ACL roles to event stream topic and resolve policies. (#14923) 2022-10-20 09:43:35 +02:00
alloc.go Add Namespace, Job and Group to envoy stats (#14311) 2022-09-22 10:38:21 -04:00
alloc_test.go client: fixed a problem calculating a service namespace. (#13493) 2022-06-28 09:47:28 +02:00
autopilot.go migrate autopilot implementation to raft-autopilot (#14441) 2022-09-01 14:27:10 -04:00
batch_future.go
batch_future_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
bitmap.go
bitmap_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
check_test.go cleanup: use constants for on_update values 2022-07-21 13:09:47 -05:00
checks.go cleanup: use constants for on_update values 2022-07-21 13:09:47 -05:00
connect.go
connect_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
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 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
consul_test.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
csi.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
csi_test.go CSI: enforce single access mode at validation time (#12337) 2022-03-23 09:21:26 -04:00
devices.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
devices_test.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
diff.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
diff_test.go cli: ignore VaultToken when generating job diff (#14424) 2022-09-01 10:01:53 -04:00
encoding.go
errors.go acl: add token expiry checking to ACL token resolution. (#13756) 2022-07-15 15:20:50 +02:00
errors_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
eval.go core: allow deleting of evaluations (#13492) 2022-07-06 16:30:11 +02:00
event.go acl: add ACL roles to event stream topic and resolve policies. (#14923) 2022-10-20 09:43:35 +02:00
extensions.go keyring: wrap root key in key encryption key (#14388) 2022-08-30 10:59:25 -04:00
funcs.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
funcs_test.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
generate.sh workload identity (#13223) 2022-07-11 13:34:05 -04:00
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 cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
network_test.go scheduler: stopped-yet-running allocs are still running (#10446) 2022-09-13 12:52:47 -07:00
node.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
node_class.go
node_class_test.go build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
node_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
operator.go client: fix data races in config handling (#14139) 2022-08-18 16:32:04 -07:00
search.go rename SecureVariables to Variables throughout 2022-08-26 16:06:24 -04:00
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 keyring: safely handle missing keys and restore GC (#15092) 2022-11-01 15:00:50 -04:00
structs_codegen.go
structs_oss.go
structs_periodic_test.go build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
structs_test.go acl: allow tokens to read policies linked via roles to the token. (#14982) 2022-10-21 09:05:17 +02:00
testing.go
uuid.go core: allow deleting of evaluations (#13492) 2022-07-06 16:30:11 +02:00
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 vault: revert support for entity aliases (#12723) 2022-04-22 10:46:34 -04:00
volume_test.go CSI: enforce single access mode at validation time (#12337) 2022-03-23 09:21:26 -04:00
volumes.go CSI: enforce single access mode at validation time (#12337) 2022-03-23 09:21:26 -04:00