question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quarkus-based distribution cannot use MariaDB with Galera replication due to XA transactions being unsupported

See original GitHub issue

Describe the bug

Using the Quarkus-based version of Keycloak 17.0.0 with a MariaDB backend with Galera replication enabled fails to start. Galera does not yet support XA transactions which Keycloak uses.

Version

17.0.0

Expected behavior

Keycloak should start normally and create a database.

Actual behavior

Keycloak fails to start with

WARN  [com.arjuna.ats.jta] (main) ARJUNA016061: TransactionImple.enlistResource - XAResource.start returned: ARJUNA016099: Unknown error code:0 for < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffffac120005:92f9:620a53be:0, node_name=quarkus, branch_uid=0:ffffac120005:92f9:620a53be:3, subordinatenodename=null, eis_name=0 >: javax.transaction.xa.XAException: (conn=140) This version of MariaDB doesn't yet support 'XA transactions with Galera replication'

How to Reproduce?

  • Set up a MariaDB with Galera replication enabled. No actual clustering is needed.
  • Build Keycloak with --db=mariadb
  • Start Keycloak using the Galera-replicated MariaDB as database

Anything else?

I’ve tried disabling XA transactions using quarkus.datasource.jdbc.transactions=enabled in conf/quarkus.properties before building Keycloak, but still get the same error.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
DGuhrcommented, Feb 23, 2022

So @999eagle fyi, this behaviour will change in the next version / latest main, you only need to run kc.sh build --db=mariadb --transaction-xa-enabled=false, no System Properties involved anymore.

2reactions
999eaglecommented, Feb 17, 2022

Hi all, I’ve tried again with -Dkc.db-tx-type=enabled -Dkc.db-driver=org.mariadb.jdbc.Driver and this seems to work. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

MariaDB Galera Cluster - Known Limitations
This article contains information on known problems and limitations of MariaDB Galera Cluster. Limitations from codership.com: Currently replication works ...
Read more >
XA Transactions - MariaDB Knowledge Base
XA transactions are designed to allow distributed transactions, where a transaction manager (the application) controls a transaction which involves multiple ...
Read more >
About Galera Replication - MariaDB Knowledge Base
In MariaDB Cluster, the Server replicates a transaction at commit time by broadcasting the write set associated with the transaction to every node...
Read more >
Tips on Converting to Galera - MariaDB Knowledge Base
You can use MyISAM and MEMORY for data that does not need to be replicated. Also, you should use "START TRANSACTION READONLY" wherever...
Read more >
What is MariaDB Galera Cluster?
Benefits. The above features yield several benefits for a DBMS clustering solution, including: No replica lag; No lost transactions; Read scalability; Smaller ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found