Repository navigation
fix(helm): Avoid corrupting storage via a lock - #7322
Merged
bacongobbler merged 3 commits intoJul 13, 2020
Merged
bacongobbler merged 3 commits into
bacongobbler merged 3 commits into
Conversation
cristiklein
pushed a commit
to cristiklein/helm
that referenced
this pull request
Jan 8, 2020
Helm does not yet properly handle concurrent executions (see helm#7322), and invoking Helm concurrently on the same release lead to corrupted storage. Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest DEPLOYED Release. Eventually, the storage will clean itself out, after the corrupted Releases are deleted due to --history-max. This is a port to Helm v3 of helm#7319. Signed-off-by: Cristian Klein <[email protected]>
cristiklein
added a commit
to cristiklein/helm
that referenced
this pull request
Jan 8, 2020
If two `helm upgrade`s are executed at the exact same time, then one of the invocations will fail with "already exists". If one `helm upgrade` is executed and a second one is started while the first is in `pending-upgrade`, then the second invocation will create a new release. Effectively, two helm invocations will simultaneously change the state of Kubernetes resources -- which is scary -- then two releases will be in `deployed` state -- which can cause other issues. This commit fixes the corrupted storage problem, by introducting a poor person's lock. If the last release is in a pending state, then helm will abort. If the last release is in a pending state, due to a previously killed helm, then the user is expected to do `helm rollback`. This is a port to Helm v2 of helm#7322. Signed-off-by: Cristian Klein <[email protected]>
cristiklein
pushed a commit
to cristiklein/helm
that referenced
this pull request
Jan 8, 2020
If two `helm upgrade`s are executed at the exact same time, then one of the invocations will fail with "already exists". If one `helm upgrade` is executed and a second one is started while the first is in `pending-upgrade`, then the second invocation will create a new release. Effectively, two helm invocations will simultaneously change the state of Kubernetes resources -- which is scary -- then two releases will be in `deployed` state -- which can cause other issues. This commit fixes the corrupted storage problem, by introducting a poor person's lock. If the last release is in a pending state, then helm will abort. If the last release is in a pending state, due to a previously killed helm, then the user is expected to do `helm rollback`. This is a port to Helm v2 of helm#7322. Signed-off-by: Cristian Klein <[email protected]>
cristiklein
pushed a commit
to cristiklein/helm
that referenced
this pull request
Jan 16, 2020
Helm does not yet properly handle concurrent executions (see helm#7322), and invoking Helm concurrently on the same release lead to corrupted storage. Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest DEPLOYED Release. Eventually, the storage will clean itself out, after the corrupted Releases are deleted due to --history-max. This is a port to Helm v3 of helm#7319. Signed-off-by: Cristian Klein <[email protected]>
mattfarina
pushed a commit
that referenced
this pull request
Jan 28, 2020
Helm does not yet properly handle concurrent executions (see #7322), and invoking Helm concurrently on the same release lead to corrupted storage. Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest DEPLOYED Release. Eventually, the storage will clean itself out, after the corrupted Releases are deleted due to --history-max. This is a port to Helm v3 of #7319. Signed-off-by: Cristian Klein <[email protected]> (cherry picked from commit 1f0582c)
bamachrn
pushed a commit
to bamachrn/helm
that referenced
this pull request
Feb 28, 2020
Helm does not yet properly handle concurrent executions (see helm#7322), and invoking Helm concurrently on the same release lead to corrupted storage. Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest DEPLOYED Release. Eventually, the storage will clean itself out, after the corrupted Releases are deleted due to --history-max. This is a port to Helm v3 of helm#7319. Signed-off-by: Cristian Klein <[email protected]>
bamachrn
pushed a commit
to bamachrn/helm
that referenced
this pull request
Feb 28, 2020
Helm does not yet properly handle concurrent executions (see helm#7322), and invoking Helm concurrently on the same release lead to corrupted storage. Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest DEPLOYED Release. Eventually, the storage will clean itself out, after the corrupted Releases are deleted due to --history-max. This is a port to Helm v3 of helm#7319. Signed-off-by: Cristian Klein <[email protected]>
bamachrn
pushed a commit
to bamachrn/helm
that referenced
this pull request
Feb 28, 2020
Helm does not yet properly handle concurrent executions (see helm#7322), and invoking Helm concurrently on the same release lead to corrupted storage. Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest DEPLOYED Release. Eventually, the storage will clean itself out, after the corrupted Releases are deleted due to --history-max. This is a port to Helm v3 of helm#7319. Signed-off-by: Cristian Klein <[email protected]>
bacongobbler
removed their request for review
March 3, 2020 00:03
Author
|
I was wondering if this is still of interest to the Helm community. |
Member
|
Sorry for the delay. My initial concern with this PR was that it may block cases like #4558 from self-resolving, but it looks like a In the meantime, if you can rebase this PR to fix the merge conflicts that would be lovely. |
bacongobbler
approved these changes
Jul 2, 2020
Contributor
|
Same issue to me |
Member
|
Thanks, @cristiklein! We've got this merged in for Helm 2. Can you please fix the merge conflict on this Helm 3 version? |
Author
|
Thanks @bridgetkromhout ! I'll do it on Monday when I have access to a proper keyboard. |
added 2 commits
July 13, 2020 22:54
If two `helm upgrade`s are executed at the exact same time, then one of the invocations will fail with "already exists". If one `helm upgrade` is executed and a second one is started while the first is in `pending-upgrade`, then the second invocation will create a new release. Effectively, two helm invocations will simultaneously change the state of Kubernetes resources -- which is scary -- then two releases will be in `deployed` state -- which can cause other issues. This commit fixes the corrupted storage problem, by introducting a poor person's lock. If the last release is in a pending state, then helm will abort. If the last release is in a pending state, due to a previously killed helm, then the user is expected to do `helm rollback`. Closes helm#7274 Signed-off-by: Cristian Klein <[email protected]>
Signed-off-by: Cristian Klein <[email protected]>
cristiklein
force-pushed
the
fix/less-corruption-with-concurrent-executions
branch
from
July 13, 2020 20:58
c01b4a8 to
20fb7ba
Compare
Signed-off-by: Cristian Klein <[email protected]>
Author
|
@bridgetkromhout I rebased against master and updated a test. Let me know what you think. |
mattfarina
pushed a commit
that referenced
this pull request
Aug 12, 2020
If two `helm upgrade`s are executed at the exact same time, then one of the invocations will fail with "already exists". If one `helm upgrade` is executed and a second one is started while the first is in `pending-upgrade`, then the second invocation will create a new release. Effectively, two helm invocations will simultaneously change the state of Kubernetes resources -- which is scary -- then two releases will be in `deployed` state -- which can cause other issues. This commit fixes the corrupted storage problem, by introducting a poor person's lock. If the last release is in a pending state, then helm will abort. If the last release is in a pending state, due to a previously killed helm, then the user is expected to do `helm rollback`. This is a port to Helm v2 of #7322. Signed-off-by: Cristian Klein <[email protected]> (cherry picked from commit c32c9a5)
4 of 6 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If two
helm upgrades are executed at the exact same time, then one ofthe invocations will fail with "already exists".
If one
helm upgradeis executed and a second one is started while thefirst is in
pending-upgrade, then the second invocation will create anew release. Effectively, two helm invocations will simultaneously
change the state of Kubernetes resources -- which is scary -- then two
releases will be in
deployedstate -- which can cause other issues.This commit fixes the corrupted storage problem, by introducting a poor
person's lock. If the last release is in a pending state, then helm will
abort. If the last release is in a pending state, due to a previously
killed helm, then the user is expected to do
helm rollback.Closes #7274
Signed-off-by: Cristian Klein [email protected]