From b5f2fb7cc6a09bb0da6897a76c103bd30eb7f307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 8 Jun 2021 16:18:46 +0300 Subject: Relax an assertion about fts_commit() --- storage/innobase/trx/trx0trx.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index d770ebaaf6c..1d27bc0bba0 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1460,12 +1460,13 @@ void trx_t::commit_low(mtr_t *mtr) if (fts_trx && undo_no) { ut_a(!is_autocommit_non_locking()); - /* FTS-FIXME: Temporarily tolerate DB_DUPLICATE_KEY instead of - dying. This is a possible scenario if there is a crash between + /* FTS-FIXME: Do this earlier, so that we can return an error, + instead of violating atomicity and corrupting data! + This is a possible scenario if there is a crash between insert to DELETED table committing and transaction committing. The fix would be able to return error from this function */ - if (dberr_t error= fts_commit(this)) - ut_a(error == DB_DUPLICATE_KEY); + if (ut_d(dberr_t error=) fts_commit(this)) + ut_ad(error == DB_DUPLICATE_KEY || error == DB_LOCK_WAIT_TIMEOUT); } #ifndef DBUG_OFF -- cgit v1.2.1