Skip to content

EbsUtils: Fall back to the SUCCESSFUL flag when snapshot state is unset - #517

Open
mateo-moon wants to merge 1 commit into
LINBIT:masterfrom
mateo-moon:fix/ebs-snapshot-restore-npe
Open

EbsUtils: Fall back to the SUCCESSFUL flag when snapshot state is unset#517
mateo-moon wants to merge 1 commit into
LINBIT:masterfrom
mateo-moon:fix/ebs-snapshot-restore-npe

Conversation

@mateo-moon

Copy link
Copy Markdown

Fixes #516.

SnapshotVolume.state is in-memory only and populated solely by EbsStatusManagerService polling, 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.SUCCESSFUL when the state is unset: the EBS creation flow (EbsProviderUtils.waitUntilSnapshotCreated) only reports success once AWS confirms the snapshot is completed, so the flag is a reliable stand-in — and the only caller (CtrlSnapshotHelper.ensureSnapshotSuccessful) already rejects non-SUCCESSFUL snapshots one check earlier.

Testing: :server:compileJava clean; live E2E on our reproducing cluster (v1.34.1-based build): restore of a Successful snapshot proceeds past the previous NPE — results posted in #516.

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
mateo-moon force-pushed the fix/ebs-snapshot-restore-npe branch from ce56b18 to 4c78f0e Compare July 22, 2026 15:38
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.

EBS snapshot restore fails with NullPointerException in SnapshotVolume.getState (v1.34.1)

1 participant