-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
Milestone
Description
During Prepare(), we rely on checkpoint data to ensure idempotency. If a claim’s checkpoint state is already ClaimCheckpointStatePrepareCompleted, we should skip device preparation on subsequent calls. However, the current flow incorrectly regresses the state from PrepareCompleted back to PrepareStarted, causing devices to be re-prepared.
Sequence of events:
1st Prepare() call
- Load checkpoint into local checkpoint.
- updateCheckpoint() immediately persists the state to
ClaimCheckpointStatePrepareStarted. - Devices are prepared.
- updateCheckpoint() persists the state as
ClaimCheckpointStatePrepareCompleted.
2nd Prepare() call
- Load checkpoint into local checkpoint (set to
ClaimCheckpointStatePrepareCompleted). - updateCheckpoint() immediately overwrites persistent state to
ClaimCheckpointStatePrepareStarted. - Local checkpoint still shows
ClaimCheckpointStatePrepareCompleted, so we skip device preparation. - Persistent state is now incorrectly set to
ClaimCheckpointStatePrepareStartedagain.
3rd Prepare() call
- Load checkpoint into local checkpoint (now set to
ClaimCheckpointStatePrepareStarted). - updateCheckpoint() again sets state to
ClaimCheckpointStatePrepareStarted. - Local state is not
ClaimCheckpointStatePrepareCompleted, so devices are prepared again.
The fix for this is proposed with the PR.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog