@@ -3,8 +3,9 @@ use concepts::prefixed_ulid::DeploymentId;
33use concepts:: storage:: {
44 CreateRequest , DbErrorWrite , DbErrorWriteNonRetriable , ExecutionEvent , ExecutionRequest ,
55 HistoryEvent , JoinSetRequest , JoinSetResponse , JoinSetResponseEvent , JoinSetResponseEventOuter ,
6- Locked , LockedBy , PendingStateFinished , PendingStateFinishedResultKind , PendingStateLocked ,
7- ResponseCursor , ResponseWithCursor , VersionType ,
6+ Locked , LockedBy , PendingStateBlockedByJoinSet , PendingStateFinished ,
7+ PendingStateFinishedResultKind , PendingStateLocked , PendingStatePendingAt , ResponseCursor ,
8+ ResponseWithCursor , VersionType ,
89} ;
910use concepts:: storage:: { ExecutionLog , PendingState , Version } ;
1011use concepts:: { ComponentId , JoinSetId } ;
@@ -29,10 +30,10 @@ pub(crate) struct ExecutionJournal {
2930impl ExecutionJournal {
3031 #[ must_use]
3132 pub fn new ( req : CreateRequest ) -> Self {
32- let pending_state = PendingState :: PendingAt {
33+ let pending_state = PendingState :: PendingAt ( PendingStatePendingAt {
3334 scheduled_at : req. scheduled_at ,
3435 last_lock : None ,
35- } ;
36+ } ) ;
3637 let execution_id = req. execution_id . clone ( ) ;
3738 let component_id = req. component_id . clone ( ) ;
3839 let deployment_id = req. deployment_id ;
@@ -305,10 +306,12 @@ impl ExecutionJournal {
305306 . enumerate ( )
306307 . rev ( )
307308 . find_map ( |( idx, event) | match & event. event {
308- ExecutionRequest :: Created { scheduled_at, .. } => Some ( PendingState :: PendingAt {
309- scheduled_at : * scheduled_at,
310- last_lock : None ,
311- } ) ,
309+ ExecutionRequest :: Created { scheduled_at, .. } => {
310+ Some ( PendingState :: PendingAt ( PendingStatePendingAt {
311+ scheduled_at : * scheduled_at,
312+ last_lock : None ,
313+ } ) )
314+ }
312315
313316 ExecutionRequest :: Finished { result, .. } => {
314317 assert_eq ! ( self . execution_events. len( ) - 1 , idx) ;
@@ -347,10 +350,10 @@ impl ExecutionJournal {
347350 | ExecutionRequest :: Unlocked {
348351 backoff_expires_at : expires_at,
349352 ..
350- } => Some ( PendingState :: PendingAt {
353+ } => Some ( PendingState :: PendingAt ( PendingStatePendingAt {
351354 scheduled_at : * expires_at,
352355 last_lock : self . find_last_lock ( ) . map ( LockedBy :: from) ,
353- } ) ,
356+ } ) ) ,
354357
355358 ExecutionRequest :: HistoryEvent {
356359 event :
@@ -390,17 +393,19 @@ impl ExecutionJournal {
390393 if let Some ( nth_created_at) = resp {
391394 // Original executor has a chance to continue, but after expiry any executor can pick up the execution.
392395 let scheduled_at = max ( * lock_expires_at, * nth_created_at) ;
393- Some ( PendingState :: PendingAt {
396+ Some ( PendingState :: PendingAt ( PendingStatePendingAt {
394397 scheduled_at,
395398 last_lock : self . find_last_lock ( ) . map ( LockedBy :: from) ,
396- } )
399+ } ) )
397400 } else {
398401 // Still waiting for response
399- Some ( PendingState :: BlockedByJoinSet {
400- join_set_id : expected_join_set_id. clone ( ) ,
401- lock_expires_at : * lock_expires_at,
402- closing : * closing,
403- } )
402+ Some ( PendingState :: BlockedByJoinSet (
403+ PendingStateBlockedByJoinSet {
404+ join_set_id : expected_join_set_id. clone ( ) ,
405+ lock_expires_at : * lock_expires_at,
406+ closing : * closing,
407+ } ,
408+ ) )
404409 }
405410 }
406411 ExecutionRequest :: Unpaused => {
0 commit comments