Skip to content

Support XA distributed transactions in CockroachDB #22329

@knz

Description

@knz

X/Open XA is a standard for distributed transaction processing across multiple database engines. This is used in enterprise scenarios where data is spread across different technologies but applications need to preserve ACID semantics for transactions that span multiple database engines.

PostgreSQL supports XA transactions by a combination of two mechanisms:

  • internally it supports the PREPARE TRANSACTION statement which enables a SQL transaction manager (TM) to "take over" transaction management
  • the official pg ODBC driver contains an implementation of the standard MSDTP API (Microsoft's view on what XA should look like), so that pg becomes interoperable with other MSDTP-aware databases.
  • ditto JDBC

For enterprise users CockroachDB should provide a path towards XA compatibility:

  • provide a mechanism / API so that an external TM can take over transaction control in CockroachDB
  • provide one or more driver extension that interoperates with one or more industry standard API (perhaps MSDTP or the java equivalent)

Strict compatibility with pg's PREPARE TRANSACTION would enable providing a XA API via pg's own ODBC driver.

cc @awoods187 for prioritization. cc @bdarnell for technical insights.

Also mentioned here: https://forum.cockroachlabs.com/t/xa-distributed-transactions/1336

Jira issue: CRDB-5863

Metadata

Metadata

Assignees

Labels

A-kv-clientRelating to the KV client and the KV interface.A-sql-executorSQL txn logicA-sql-pgcompatSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-kvKV Team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions