Skip to content

Commit 1e3f43b

Browse files
committed
cre-1601: comments improved
1 parent a1e8307 commit 1e3f43b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/workflows/ring/plugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (p *Plugin) Outcome(_ context.Context, outctx ocr3types.OutcomeContext, _ t
200200
func (p *Plugin) calculateNextState(priorState *pb.RoutingState, wantShards uint32, now time.Time) (*pb.RoutingState, error) {
201201
switch ps := priorState.State.(type) {
202202
case *pb.RoutingState_RoutableShards:
203-
// If already at desired count, stay in stable state
203+
// No transition needed; avoid unnecessary workflow redistribution
204204
if ps.RoutableShards == wantShards {
205205
return priorState, nil
206206
}
@@ -218,12 +218,12 @@ func (p *Plugin) calculateNextState(priorState *pb.RoutingState, wantShards uint
218218
}, nil
219219

220220
case *pb.RoutingState_Transition:
221-
// If still in safety period, stay in transition
221+
// Wait for all nodes to sync before committing to new shard assignments
222222
if now.Before(ps.Transition.ChangesSafeAfter.AsTime()) {
223223
return priorState, nil
224224
}
225225

226-
// Safety period elapsed, transition to stable state
226+
// All nodes have synced; commit to new routing configuration
227227
return &pb.RoutingState{
228228
Id: priorState.Id + 1,
229229
State: &pb.RoutingState_RoutableShards{

0 commit comments

Comments
 (0)