You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.InfoContext(ctx, "Channel upgrade steps completed up to the target states. Check the resulting states, as cancellations or timeouts can also lead to this result.")
171
164
returntrue, nil
172
165
}
173
166
@@ -809,21 +802,55 @@ func buildActionMsg(
809
802
}
810
803
}
811
804
812
-
// hasReachedOrPassedTargetState checks if the current state has reached or passed the target state,
813
-
// including cases where the target state is skipped.
805
+
// validateTargetStates returns an error if the target state pair is meaningless or unreachable.
806
+
// Assume the current state pair is (INIT, UNINIT).
807
+
//
808
+
// - The target state pair (INIT, UNINIT) is meaningless as a target
809
+
// because this function would not cause any state change.
810
+
// - The target state pair (UNINIT, INIT) is unreachable.
811
+
//
812
+
// Therefore, it is unlikely that a user would intentionally specify either pair
813
+
// after initializing an upgrade on only one side, so we treat them as invalid
814
+
// and return an error.
815
+
//
816
+
// This validation also simplifies the logic of hasPassedTargetState.
817
+
// For example,
818
+
//
819
+
// - target state pair: (UNINIT, INIT)
820
+
// - current state pair: (INIT, UNINIT)
821
+
//
822
+
// In this case, hasPassedTargetState(UNINIT, INIT, INIT) returns false
823
+
// and the upgrade proceeds to the next step, which is unexpected.
824
+
// By rejecting this target state pair, the function does not need to handle this case.
0 commit comments