WangzJi opened a new issue, #8040:
URL: https://github.com/apache/incubator-seata/issues/8040

   Check Ahead
   - [x] I have searched the issues of this repository and believe that this is 
not a duplicate.
   - [ ] I am willing to try to implement this feature myself.
   
   Why you need it?
   Seata already supports annotation-based Saga through the 
`saga/seata-saga-annotation` module. This path is based on 
`@SagaTransactional`, `@CompensationBusinessAction`, and 
`BranchType.SAGA_ANNOTATION`.
   
   However, `seata-benchmark-cli` currently only supports `AT`, `TCC`, and 
`SAGA`. That means benchmark coverage is still incomplete from a Saga 
perspective: we can benchmark the traditional state-machine Saga path, but we 
cannot benchmark the annotation-based Saga path.
   
   If the goal of the benchmark module is to gradually cover all major Seata 
transaction modes, then `SAGA_ANNOTATION` is an obvious missing part. Without 
it, users and contributors cannot compare the annotation-based Saga execution 
path with other modes in a unified benchmark tool.
   
   How it could be?
   A possible direction is to add a dedicated benchmark mode for 
annotation-based Saga, for example:
   
   ```bash
   --mode SAGA_ANNOTATION
   ```
   
   or another CLI-friendly alias if maintainers prefer one.
   
   Possible implementation scope:
   
   - extend `BenchmarkConfig` mode validation to accept the new mode
   - extend `BenchmarkRunner` dispatch logic and add a dedicated executor for 
annotation-based Saga benchmarking
   - provide a minimal benchmark scenario based on `@SagaTransactional` and 
`@CompensationBusinessAction`
   - bootstrap a minimal Spring context or another suitable integration path so 
annotation scanning, proxying, and Saga resource registration work correctly
   - define clear semantics for `--branches` and rollback percentage in this 
mode
   - update README with runnable examples and explain the difference between 
`SAGA` and `SAGA_ANNOTATION`
   
   Expected outcome:
   
   - benchmark CLI can run annotation-based Saga end-to-end against a TC
   - rollback / compensation behavior can be exercised and reflected in metrics
   - benchmark users can compare traditional Saga and annotation-based Saga 
separately and explicitly
   
   Other related information
   Current implementation evidence:
   
   - 
`test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/BenchmarkRunner.java`
     - currently only creates executors for `AT`, `TCC`, and `SAGA`
   - 
`test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/config/BenchmarkConfig.java`
     - currently validates only `AT`, `TCC`, and `SAGA`
   - `core/src/main/java/org/apache/seata/core/model/BranchType.java`
     - already contains `SAGA_ANNOTATION`
   - 
`saga/seata-saga-annotation/src/main/java/org/apache/seata/saga/rm/api/SagaTransactional.java`
   - 
`saga/seata-saga-annotation/src/main/java/org/apache/seata/saga/rm/api/CompensationBusinessAction.java`
   
   Design notes that may need discussion during implementation:
   
   - whether the CLI mode name should be `SAGA_ANNOTATION`, `SAGA-ANNOTATION`, 
or both
   - whether a small Spring container is the best benchmark bootstrap approach
   - how `--branches` should map to annotation-based Saga steps in a way that 
is intuitive and comparable with other modes
   
   Non-goal for this issue:
   
   - improving the existing traditional/state-machine Saga benchmark 
(`BranchType.SAGA`) should be tracked separately.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to