Skip to content

feature: benchmark CLI - add XA mode support #8010

Description

@WangzJi

Check Ahead

  • 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 supports four major transaction modes: AT, TCC, SAGA, and XA. However, seata-benchmark-cli currently only supports AT, TCC, and SAGA.

At the moment, XA is missing from the benchmark CLI entirely:

  • BenchmarkConfig.validateMode() rejects XA
  • BenchmarkRunner.createExecutor() does not provide an XA executor

This leaves benchmark coverage incomplete and prevents users from comparing XA behavior with the other supported transaction modes in the same tool.

How it could be?

A possible direction is:

  • add XA support to benchmark CLI mode validation and runner dispatch
  • introduce XAModeExecutor following the general structure used by the other executors
  • keep --branches 0 as empty mode for pure protocol-overhead testing
  • support --branches > 0 as real XA mode
  • implement a practical MVP for real XA mode using MySQL XA with Testcontainers
  • define clear --branches semantics, for example: each global transaction registers N XA branches
  • support rollback scenarios through --rollback-percentage
  • update README with runnable examples and explain the behavior of empty mode vs real XA mode

If needed, the first implementation can prioritize a simple, reproducible XA benchmark setup before expanding to more advanced multi-resource scenarios.

Other related information

Current implementation evidence:

  • test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/config/BenchmarkConfig.java
  • test-suite/seata-benchmark-cli/src/main/java/org/apache/seata/benchmark/BenchmarkRunner.java
  • test-suite/seata-benchmark-cli/README.md

Suggested acceptance criteria:

  • benchmark CLI accepts --mode XA
  • --branches 0 runs empty XA benchmark mode
  • --branches > 0 runs a real XA benchmark path
  • rollback percentage can trigger XA rollback behavior
  • final report remains consistent with existing benchmark output
  • README includes at least one runnable XA benchmark example

Metadata

Metadata

Assignees

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions