MDEV-35966 galera.galera_as_master crashes in debug builds

innobase_commit(): When Galera is used with SET SQL_LOG_BIN=OFF,
some debug assertions that had been added in
commit ddd7d5d8e3 (MDEV-24035)
would fail. Let us relax those assertions for Galera transactions,
to allow an implicit commit after an internally executed XA PREPARE.

Note that trx_undo_report_row_operation() only allows undo log records
to be added to ACTIVE transactions (not after XA PREPARE). Hence, this
relaxation should be safe with respect to writes.
This commit is contained in:
Marko Mäkelä 2025-01-29 10:42:01 +02:00 committed by Sergei Golubchik
parent 3cfffb4de6
commit d5e7bce14b

View file

@ -4677,9 +4677,10 @@ innobase_commit(
ut_ad("invalid state" == 0);
/* fall through */
case TRX_STATE_PREPARED:
ut_ad(commit_trx);
ut_ad(commit_trx || trx->is_wsrep());
ut_ad(thd_test_options(thd, OPTION_NOT_AUTOCOMMIT
| OPTION_BEGIN));
| OPTION_BEGIN)
|| trx->is_wsrep());
/* fall through */
case TRX_STATE_ACTIVE:
/* Transaction is deregistered only in a commit or a