-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a paramter in state store methods to indicate whether a resource insertion is from a snapshot restoration #9156
Conversation
…g a snapshot restore in a bunch of places The Catalog, Config Entry, KV and Session resources potentially re-validate the input as its coming in. We need to prevent snapshot restoration failures due to missing namespaces or namespaces that are being deleted in enterprise.
b7d0c92
to
06601a0
Compare
Would you want to use the same mechanism to help with item replication in a secondary DC as we had discussed separately recently? |
@rboyer We probably want something very similar for that. It probably will slightly alter what this code touches but needs to have some extra data baked into the request types so that we can know when applying to the FSM whether it was a normal write or a replication write. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍒 Starting backport cherry picking. To cherry-pick post-merge, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/278129. |
🍒✅ Cherry pick of commit 71da020 onto |
…insertion is from a snapshot restoration (#9156) The Catalog, Config Entry, KV and Session resources potentially re-validate the input as its coming in. We need to prevent snapshot restoration failures due to missing namespaces or namespaces that are being deleted in enterprise.
…insertion is from a snapshot restoration (#9156) The Catalog, Config Entry, KV and Session resources potentially re-validate the input as its coming in. We need to prevent snapshot restoration failures due to missing namespaces or namespaces that are being deleted in enterprise. # Conflicts: # agent/consul/state/catalog.go # agent/consul/state/catalog_events_test.go # agent/consul/state/catalog_oss.go # agent/consul/state/kvs.go # agent/consul/state/kvs_oss.go # agent/consul/state/session.go # agent/consul/state/session_oss.go
…insertion is from a snapshot restoration (#9156) The Catalog, Config Entry, KV and Session resources potentially re-validate the input as its coming in. We need to prevent snapshot restoration failures due to missing namespaces or namespaces that are being deleted in enterprise. # Conflicts: # agent/consul/state/catalog.go # agent/consul/state/catalog_events_test.go # agent/consul/state/catalog_oss.go # agent/consul/state/kvs.go # agent/consul/state/kvs_oss.go # agent/consul/state/session.go # agent/consul/state/session_oss.go
This helps fix an issue in Consul Enterprise, where the rest of the fix is, where snapshots can fail to restore if a namespace deletion was in progress when the snapshot was taken.
The fix is to ignore namespace existence checks when we are restoring data and then let the deferred namespace deletion routines delete the data normally.