[Commits] 93346c2: Fix bad 10.2 InnoDB merge.

Kristian Nielsen knielsen at knielsen-hq.org
Thu Sep 1 12:22:54 EEST 2016


revision-id: 93346c264c8a618034648ca55ba417f9dcf49340 (mariadb-10.2.1-8-g93346c2)
parent(s): f265ab5fb331f4a63d8ee502f4e1f044552676c7
committer: Kristian Nielsen
timestamp: 2016-09-01 11:14:49 +0200
message:

Fix bad 10.2 InnoDB merge.

The thd_report_wait_for() call was incorrectly skipped whenever
deadlock checker did not find any deadlocks. This effectively disables
optimistic parallel replication deadlock kills in most cases, causing
hangs or stalls.

Signed-off-by: Kristian Nielsen <knielsen at knielsen-hq.org>

---
 storage/innobase/lock/lock0lock.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 857cb68..fea9d42 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -8077,7 +8077,7 @@ lock_report_waiters_to_mysql(
 /*=======================*/
 	struct thd_wait_reports*	waitee_buf_ptr,	/*!< in: set of trxs */
 	THD*				mysql_thd,	/*!< in: THD */
-	trx_id_t			victim_trx_id)	/*!< in: Trx selected
+	const trx_t*			victim_trx)	/*!< in: Trx selected
 							as deadlock victim, if
 							any */
 {
@@ -8092,7 +8092,7 @@ lock_report_waiters_to_mysql(
 			trx_t *w_trx = p->waitees[i];
 			/*  There is no need to report waits to a trx already
 			selected as a victim. */
-			if (w_trx->id != victim_trx_id) {
+			if (w_trx != victim_trx) {
 				/* If thd_report_wait_for() decides to kill the
 				transaction, then we will get a call back into
 				innobase_kill_query. We mark this by setting
@@ -8153,10 +8153,10 @@ DeadlockChecker::check_and_resolve(const lock_t* lock, const trx_t* trx)
 		victim_trx = checker.search();
 
 		/* Report waits to upper layer, as needed. */
-		if (victim_trx && waitee_buf_ptr) {
+		if (waitee_buf_ptr) {
 			lock_report_waiters_to_mysql(waitee_buf_ptr,
 						     start_mysql_thd,
-						     victim_trx->id);
+						     victim_trx);
 		}
 
 		/* Search too deep, we rollback the joining transaction only


More information about the commits mailing list