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

state: fix state store corruption in plan apply #19937

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented Feb 9, 2024

The state store's UpsertPlanResults method canonicalizes allocations in order to upgrade them to a new version. But the method does not copy the allocation before doing so, which can potentially corrupt the state store. This hasn't been implicated in any known user-facing bugs, but was detected when running Nomad under a build with the Go toolchain's data race detection enabled.

Noticed while working on #19932, but it looks like this bug has existed since 0.10.4

The state store's `UpsertPlanResults` method canonicalizes allocations in order
to upgrade them to a new version. But the method does not copy the allocation
before doing so, which can potentially corrupt the state store. This hasn't been
implicated in any known user-facing bugs, but was detected when running Nomad
under a build with Go toolchains data race detection enabled.
@tgross tgross added type/bug backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line labels Feb 9, 2024
@tgross tgross marked this pull request as ready for review February 9, 2024 21:40
@tgross tgross added this to the 1.7.x milestone Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants