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

fsm: Fix snapshot bug with restoring node/service/check indexes #8474

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

kyhavlov
Copy link
Contributor

This PR fixes a bug where nodes, services, and checks would not be restored with the correct Create/ModifyIndex when restoring from a snapshot. The KV entries didn't have this issue because we do a raw tx.Insert of the entry that we read from the transaction (so it includes the Create/ModifyIndex), but when loading in catalog objects we have to do additional bookkeeping, so we weren't doing a raw insert there. This PR adds a preserveIndex argument to some of the internal state store functions to enable keeping the index we read from the snapshot, without allowing users to arbitrarily modify these fields during a normal update.

Fixes #8377.

agent/consul/state/catalog.go Outdated Show resolved Hide resolved
agent/consul/state/catalog.go Outdated Show resolved Hide resolved
Copy link
Contributor

@freddygv freddygv left a comment

Choose a reason for hiding this comment

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

LGTM

@kyhavlov kyhavlov merged commit 9bc9d30 into master Aug 11, 2020
@kyhavlov kyhavlov deleted the snapshot-index-fix branch August 11, 2020 19:35
@hashicorp-ci
Copy link
Contributor

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

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.

Inconsistent Consul Catalog
4 participants