diff --git a/server/src/main/java/com/linbit/linstor/layer/storage/ebs/EbsUtils.java b/server/src/main/java/com/linbit/linstor/layer/storage/ebs/EbsUtils.java index 04dcffa60..da2cec4e2 100644 --- a/server/src/main/java/com/linbit/linstor/layer/storage/ebs/EbsUtils.java +++ b/server/src/main/java/com/linbit/linstor/layer/storage/ebs/EbsUtils.java @@ -13,6 +13,7 @@ import com.linbit.linstor.core.objects.Node; import com.linbit.linstor.core.objects.Resource; import com.linbit.linstor.core.objects.Snapshot; +import com.linbit.linstor.core.objects.SnapshotDefinition; import com.linbit.linstor.core.objects.SnapshotVolume; import com.linbit.linstor.core.objects.StorPool; import com.linbit.linstor.core.objects.Volume; @@ -201,7 +202,23 @@ public static boolean isSnapshotCompleted(Snapshot snapshotRef) while (snapVlmIt.hasNext()) { SnapshotVolume snapVlm = snapVlmIt.next(); - allCompleted &= snapVlm.getState().equals(EBS_SNAP_STATE_COMPLETED); + @Nullable String state = snapVlm.getState(); + if (state == null) + { + /* + * The in-memory state is only populated by the EBS status poller, so it can be unset + * right after the snapshot was taken or after a controller restart. A snapshot whose + * creation flow finished (SUCCESSFUL flag) was already confirmed 'completed' by AWS + * before the satellite reported success, so fall back to that flag. + */ + allCompleted &= snapshotRef.getSnapshotDefinition() + .getFlags() + .isSet(SnapshotDefinition.Flags.SUCCESSFUL); + } + else + { + allCompleted &= state.equals(EBS_SNAP_STATE_COMPLETED); + } } return allCompleted; }