Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down