[MDEV-19995] Spider XA operations may lock spider_xa_member for a long time, limiting concurrency Created: 2019-07-09  Updated: 2023-09-20

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Leandro Pacheco (Inactive) Assignee: Yuchen Pei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Some spider XA operations, most critically XA PREPARE, through either explicit or internal XA, keep the mysql.spider_xa_member locked while executing commands on backends.
During that time, no other spider XA transaction is able to XA PREPARE or XA COMMIT, as they are waiting for the table lock.

Considering the case of XA PREPARE (through spider_internal_xa_prepare):
It keeps the table locked while executing XA END followed by XA PREPARE, on each involved backend, sequentially.
That can be particularly bad if, for example:

  1. the latency between spider and backends is non-negligible
  2. multiple backends are involved
  3. the backend thread or connection somehow gets killed/stuck, and spider_net_read_timeout is set too high (default seems to be 600 seconds).

This behavior limits throughput by latency and in the worst case (#3) may block other transactions for a long time.

Other functions which seem to do something similar are spider_internal_xa_commit_by_xid and spider_internal_xa_rollback_by_xid.


Generated at Thu Feb 08 08:55:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.