EbsUtils: Fall back to the SUCCESSFUL flag when snapshot state is unset - #517
Open
mateo-moon wants to merge 1 commit into
Open
EbsUtils: Fall back to the SUCCESSFUL flag when snapshot state is unset#517mateo-moon wants to merge 1 commit into
mateo-moon wants to merge 1 commit into
Conversation
This was referenced Jul 21, 2026
SnapshotVolume's state is an in-memory field populated only by the EBS status poller, so it can be unset right after a snapshot was taken or after a controller restart. isSnapshotCompleted dereferenced it unconditionally, failing every EBS snapshot restore with a NullPointerException. Treat an unset state as completed if and only if the snapshot definition carries the SUCCESSFUL flag: the EBS snapshot creation flow only reports success after AWS confirmed the snapshot completed, so the flag is a reliable stand-in for the volatile state. Fixes LINBIT#516
mateo-moon
force-pushed
the
fix/ebs-snapshot-restore-npe
branch
from
July 22, 2026 15:38
ce56b18 to
4c78f0e
Compare
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.
Fixes #516.
SnapshotVolume.stateis in-memory only and populated solely byEbsStatusManagerServicepolling, so it is legitimately unset right after snapshot creation and always unset after a controller restart.EbsUtils.isSnapshotCompleted()dereferenced it unconditionally, which made every EBS snapshot restore fail with an NPE.Fall back to
SnapshotDefinition.Flags.SUCCESSFULwhen the state is unset: the EBS creation flow (EbsProviderUtils.waitUntilSnapshotCreated) only reports success once AWS confirms the snapshot iscompleted, so the flag is a reliable stand-in — and the only caller (CtrlSnapshotHelper.ensureSnapshotSuccessful) already rejects non-SUCCESSFUL snapshots one check earlier.Testing:
:server:compileJavaclean; live E2E on our reproducing cluster (v1.34.1-based build): restore of aSuccessfulsnapshot proceeds past the previous NPE — results posted in #516.