maria:bb-10.4-MDEV-21910-v2

Last commit made on 2020-05-06
Get this branch:
git clone -b bb-10.4-MDEV-21910-v2 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.4-MDEV-21910-v2
Repository:
lp:maria

Recent commits

21fa04e... by Jan Lindström

Analysis from 10.4

BF abort:
wsrep_kill_victim (lock_sys->mutex, trx->mutex) => wsrep_kill_one_trx (thd->LOCK_thd_data)

KILL QUERY:
find_thread_by_id(thd->LOCK_thd_data , thd->LOCK_thd_kill) => thd->awake_no_mutex() => innobase_kill_query() => lock_trx_handle_wait( lock_sys->mutex, trx->mutex if not wsrep victim)

From these only lock_sys->mutex is global mutex. All others are either thread internal (thd) or transaction internal (trx). Therefore, mutex deadlock is possible if and only if thread we have selected as victim for BF abort and thread user is trying to kill are exactly the same one. While BF abort also will call thd->awake() it will have trx->lock.was_chosen_as_wsrep_victim=true and then we do not take lock_sys->mutex or trx->mutex at lock_trx_handle_wait(). Second problem is possible when in wsrep_kill_one_trx() we set trx->lock.was_chosen_as_wsrep_victim=true and release thd->LOCK_thd_data mutex. Now if we have a schedule where KILL is executed there is possibility that we either try to take lock_sys->mutex and have to wait or if this is same thread as victim no InnoDB mutexes are taken. Furthermore, in bf_abort() we might take thd->LOCK_thd_data again in wsrep-lib.

In this fix candidate we release lock_sys->mutex and trx->mutex before
we call wsrep_innobase_kill_one_trx(). Thus, it is safe to take
thd->LOCK_thd_data similarly as KILL does. We can remove
was_chosen_as_wsrep_victim variable from trx as it is not anymore
needed.

2c3c851... by Marko Mäkelä

Merge 10.3 into 10.4

4742905... by Marko Mäkelä

MDEV-22465: DROP indexed COLUMN is wrongly claimed to be ALGORITHM=INSTANT

ha_innobase::check_if_supported_inplace_alter(): Do not allow
ALGORITHM=INSTANT for operations that avoid a table rebuild
but involve dropping (or creating) secondary indexes.

69925c0... by Kentoku SHIBA

MDEV-20502 Queries against spider tables return wrong values for columns following constant declarations.

Add test cases.

37a01ac... by Jan Lindström

MDEV-21489 : wsrep_cluster_conf_id has wrong value

Do not show exact value as it depends order of test execution.
Instead use # for correct values and ERROR for incorrect.

1ed9878... by Marko Mäkelä

MDEV-22452: Fix cmake -DWITH_WSREP=OFF

commit 5e7e7153b439ea1b12588f5830d66b3a0cf13414 accidentally
broke the build without WSREP, by misplacing an #endif.

8648b9b... by Marko Mäkelä

Merge 10.2 into 10.3

1cccd3c... by Marko Mäkelä

MDEV-7962: Fix cmake WITH_WSREP=OFF

commit d467bb7e5e7902cf763c86cae71fde4f08e2ae3e accidentally
broke the build without WSREP, by misplacing an #endif.

3f65ce5... by Marko Mäkelä

Merge 10.1 into 10.2

d467bb7... by Marko Mäkelä

MDEV-7962 post-push fixes

This is a partial backport of
commit 5e7e7153b439ea1b12588f5830d66b3a0cf13414 from 10.4.

assert_trx_is_free(): Assert !is_wsrep().

trx_init(): Do not initialize trx->wsrep, because it must have been
initialized already.

trx_commit_in_memory(): Invoke wsrep_commit_ordered(). This call
was being skipped, because the transaction object had already been
freed to the pool.

trx_rollback_for_mysql(), innobase_commit_low(),
innobase_rollback_trx(): Always reset trx->wsrep.