incubator-seata-go icon indicating copy to clipboard operation
incubator-seata-go copied to clipboard

Compensatory and forward operations in seata-go Saga

Open ptyin opened this issue 1 year ago • 0 comments

This is a subtask under the #618

Description:

This feature request involves implementing compensatory and forward operations for the state machine. In the current Java implementation, part of the compensatory logic resides in the CompensateTriggerHandler. In seata-go, we won't initially implement the CompensateTrigger state but instead externalize the corresponding logic.

Implementation Details:

1. Compensatory Operation:

  • Externalize compensatory logic from the CompensateTriggerHandler. In the initial phase, avoid implementing the CompensateTrigger state but focus on preparing the groundwork for compensatory operations.

2. Forward Operation:

  • Implement forward operations for the state machine. The relevant code is concentrated within StateMachineEngine#forward in the Java implementation.

Next Steps:

  1. Compensatory Operation:

    • Externalize the compensatory logic from the CompensateTriggerHandler. While postponing the implementation of the CompensateTrigger state, ensure that the groundwork for compensatory operations is established.
  2. Forward Operation:

    • Implement the forward operations for the state machine. Refer to the logic present in StateMachineEngine#forward in the Java codebase for guidance.

By following these steps, we aim to introduce compensatory and forward operations in the seata-go state machine. Externalizing compensatory logic and implementing forward operations will contribute to the overall functionality of the state machine.

ptyin avatar Jan 03 '24 05:01 ptyin