Skip to content
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

Merged
merged 1 commit into from
Nov 11, 2020

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Nov 11, 2020

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.

…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.
@mikemorris mikemorris added this to the 1.9.0 milestone Nov 11, 2020
@mkeeler mkeeler requested a review from a team November 11, 2020 15:55
@rboyer
Copy link
Member

rboyer commented Nov 11, 2020

Would you want to use the same mechanism to help with item replication in a secondary DC as we had discussed separately recently?

@mkeeler
Copy link
Member Author

mkeeler commented Nov 11, 2020

@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.

Copy link
Member

@rboyer rboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@mkeeler mkeeler merged commit 71da020 into master Nov 11, 2020
@mkeeler mkeeler deleted the oss-sync/2020.11.11 branch November 11, 2020 16:21
@hashicorp-ci
Copy link
Contributor

🍒 Starting backport cherry picking.

To cherry-pick post-merge, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/278129.

@hashicorp-ci
Copy link
Contributor

🍒✅ Cherry pick of commit 71da020 onto release/1.9.x succeeded!

hashicorp-ci pushed a commit that referenced this pull request Nov 11, 2020
…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.
@hashicorp-ci
Copy link
Contributor

🍒❌ Cherry pick of commit 71da020 onto release/1.8.x failed! Build Log

mkeeler added a commit that referenced this pull request Nov 11, 2020
…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
mkeeler added a commit that referenced this pull request Nov 11, 2020
…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
@mkeeler mkeeler mentioned this pull request Nov 11, 2020
mkeeler added a commit that referenced this pull request Nov 11, 2020
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.
mkeeler added a commit that referenced this pull request Nov 11, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants