Hi,

All other looks correct, I'm concerned only following change that is not needed
to fix this bug:

On Thu, Dec 8, 2016 at 2:35 PM, <marko.makela@mariadb.com> wrote:


-               err = lock_trx_handle_wait(trx,
-                       (lock_mutex_taken || already_have_lock_mutex),
-                       (trx_mutex_taken || already_have_trx_mutex));
+#ifdef UNIV_DEBUG
+               dberr_t err =
+#endif
+               lock_trx_handle_wait(trx, true, true);
+
+               ut_ad(err == DB_SUCCESS || err == DB_LOCK_WAIT
+                     || err == DB_DEADLOCK);



In above is true, true always correct? we conditionally take lock and trx mutexes on some cases if we already do not have them, and below function will take them if they are not
already taken. There is complex rules as Galera can call this from different situations and we already have had cases where some mutex was taken twice or no mutex was taken.

R: Jan