Open
Description
Description
Currently, VTGate tracks per-shard transaction state in the session to identify if DMLs modified any underlying database. However, during cross-shard transactions, all participating shards (including read-only ones) are part of the atomic commit path.
This task involves:
- Ensuring that only modified shards are part of the cross-shard commit path using the atomic commit flow.
- Keeping read-only shards on the direct commit path to prevent unnecessary inclusion in atomic commit operations.
Impact
By restricting the atomic commit path to modified shards only, this change will:
- Improve efficiency by minimizing the number of shards involved in the two-phase commit.
- Reduce overhead on read-only shards that do not need atomic commit guarantees.
- Potentially reduce cross-shard transactions to single-shard ACID if only one shard is modified.