[Commits] f5769e497dd: MDEV-17705: Review InnoDB changes on Galera 4 wsrep patch

jan jan.lindstrom at mariadb.com
Mon Jan 14 11:29:25 EET 2019


revision-id: f5769e497dd1d1b7355b92a0c51970a94726025c (mariadb-10.3.6-298-gf5769e497dd)
parent(s): 18279fc377e5c087e30a23b425f2c866a796f255
author: Jan Lindström
committer: Jan Lindström
timestamp: 2019-01-14 11:27:54 +0200
message:

MDEV-17705: Review InnoDB changes on Galera 4 wsrep patch

Remove unnecessary changes and fix coding style.
	modified:   mysql-test/include/mtr_warnings.sql
	modified:   mysql-test/suite/innodb/r/innodb-index-online-fk.result
	modified:   mysql-test/suite/innodb/t/innodb-index-online-fk.test
	modified:   storage/innobase/handler/ha_innodb.cc
	modified:   storage/innobase/include/trx0trx.h
	modified:   storage/innobase/row/row0sel.cc
	modified:   storage/innobase/trx/trx0roll.cc
	modified:   storage/innobase/trx/trx0rseg.cc
	modified:   storage/innobase/trx/trx0trx.cc

---
 mysql-test/include/mtr_warnings.sql                     |  1 +
 mysql-test/suite/innodb/r/innodb-index-online-fk.result | 10 +++++-----
 mysql-test/suite/innodb/t/innodb-index-online-fk.test   | 10 +++++-----
 storage/innobase/handler/ha_innodb.cc                   | 15 ++++++---------
 storage/innobase/include/trx0trx.h                      |  4 ++--
 storage/innobase/row/row0sel.cc                         |  4 +++-
 storage/innobase/trx/trx0roll.cc                        |  1 -
 storage/innobase/trx/trx0rseg.cc                        |  4 ++--
 storage/innobase/trx/trx0trx.cc                         |  1 -
 9 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 4cdc9868c22..524ea0f4859 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -229,6 +229,7 @@ INSERT INTO global_suppressions VALUES
    MDEV-12501 -- set --maturity-level by default
  */
  ("Plugin .* is of maturity level .* while the server is .*"),
+
  ("THE_LAST_SUPPRESSION")||
 
 
diff --git a/mysql-test/suite/innodb/r/innodb-index-online-fk.result b/mysql-test/suite/innodb/r/innodb-index-online-fk.result
index 6ec5a72db25..47fc8e8b840 100644
--- a/mysql-test/suite/innodb/r/innodb-index-online-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-index-online-fk.result
@@ -118,7 +118,7 @@ SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, informati
 name	name
 test/child	a1
 test/child	a2
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 NAME
 SYS_DATAFILES
 SYS_FOREIGN
@@ -310,7 +310,7 @@ SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, informati
 name	name
 test/child	a1
 test/child	a2
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 NAME
 SYS_DATAFILES
 SYS_FOREIGN
@@ -336,7 +336,7 @@ SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, informati
 name	name
 test/child	a2
 test/child	a3
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 NAME
 SYS_DATAFILES
 SYS_FOREIGN
@@ -373,7 +373,7 @@ SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, informati
 name	name
 test/child	a1
 test/child	a2
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 NAME
 SYS_DATAFILES
 SYS_FOREIGN
@@ -410,7 +410,7 @@ SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, informati
 name	name
 test/child	a2
 test/child	a3
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 NAME
 SYS_DATAFILES
 SYS_FOREIGN
diff --git a/mysql-test/suite/innodb/t/innodb-index-online-fk.test b/mysql-test/suite/innodb/t/innodb-index-online-fk.test
index dd185a9843a..5c8954064ce 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-index-online-fk.test
@@ -105,7 +105,7 @@ SELECT * FROM information_schema.INNODB_SYS_FOREIGN_COLS;
 
 SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, information_schema.innodb_sys_tables t2 WHERE t1.table_id = t2.table_id AND t2.name LIKE "%child" ORDER BY t1.name;
 
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 
 # this should succeed, since we disabled the foreign key check
 INSERT INTO child VALUES(5,4);
@@ -287,7 +287,7 @@ SET DEBUG_DBUG = @saved_debug_dbug;
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
 SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, information_schema.innodb_sys_tables t2 WHERE t1.table_id = t2.table_id AND t2.name LIKE "%child" ORDER BY t1.name;
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 
 # This should be successful. It will also check any left over
 # from previous failed operation (if dictionary entries not cleaned,
@@ -300,7 +300,7 @@ ALGORITHM = INPLACE;
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
 SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
 SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, information_schema.innodb_sys_tables t2 WHERE t1.table_id = t2.table_id AND t2.name LIKE "%child" ORDER BY t1.name;
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 
 SHOW CREATE TABLE child;
 
@@ -317,7 +317,7 @@ ALGORITHM = INPLACE;
 SELECT * from information_schema.INNODB_SYS_FOREIGN;
 SELECT * from information_schema.INNODB_SYS_FOREIGN_COLS;
 SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, information_schema.innodb_sys_tables t2 WHERE t1.table_id = t2.table_id AND t2.name LIKE "%child" ORDER BY t1.name;
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 
 SHOW CREATE TABLE child;
 
@@ -333,7 +333,7 @@ ALGORITHM = INPLACE;
 SELECT * from information_schema.INNODB_SYS_FOREIGN;
 SELECT * from information_schema.INNODB_SYS_FOREIGN_COLS;
 SELECT t2.name, t1.name FROM information_schema.innodb_sys_columns t1, information_schema.innodb_sys_tables t2 WHERE t1.table_id = t2.table_id AND t2.name LIKE "%child" ORDER BY t1.name;
-SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE NAME NOT LIKE 'wsrep%';
+SELECT NAME FROM information_schema.INNODB_SYS_TABLES;
 
 SHOW CREATE TABLE child;
 
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index c371f6b270c..fe3fee6d5d2 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -8207,8 +8207,8 @@ ha_innobase::write_row(
 		if (wsrep_append_keys(m_user_thd, WSREP_SERVICE_KEY_EXCLUSIVE,
 				      record,
 				      NULL)) {
- 			DBUG_PRINT("wsrep", ("row key failed"));
- 			error_result = HA_ERR_INTERNAL_ERROR;
+			DBUG_PRINT("wsrep", ("row key failed"));
+			error_result = HA_ERR_INTERNAL_ERROR;
 			goto wsrep_error;
 		}
 	}
@@ -18609,7 +18609,7 @@ wsrep_innobase_kill_one_trx(
 	 * which is already marked as BF victim
 	 * lock_sys is held until this vicitm has aborted
 	 */
-	victim_trx->lock.was_chosen_as_wsrep_victim= TRUE;
+	victim_trx->lock.was_chosen_as_wsrep_victim = TRUE;
 
 	wsrep_thd_UNLOCK(thd);
 	if (wsrep_thd_bf_abort(bf_thd, thd, signal))
@@ -18625,10 +18625,9 @@ wsrep_innobase_kill_one_trx(
 				lock_cancel_waiting_and_release(wait_lock);
 			}
 		}
-	}
-	else {
+	} else {
 		/* victim was not BF aborted, after all */
-		victim_trx->lock.was_chosen_as_wsrep_victim= TRUE;
+		victim_trx->lock.was_chosen_as_wsrep_victim = TRUE;
 	}
 
 	DBUG_RETURN(0);
@@ -18662,9 +18661,7 @@ wsrep_abort_transaction(
 		lock_mutex_exit();
 		wsrep_srv_conc_cancel_wait(victim_trx);
 		DBUG_RETURN(rcode);
-	}
-	else
-	{
+	} else {
 		wsrep_thd_bf_abort(bf_thd, victim_thd, signal);
 	}
 
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index 7ef5c624707..8bf64c28441 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -579,8 +579,8 @@ struct trx_lock_t {
 					serving the running transaction. */
 #ifdef WITH_WSREP
 	bool		was_chosen_as_wsrep_victim;
-					/*!< high priority wsrep thread has marked
-					  this trx to abort */ 
+					/*!< high priority wsrep thread has
+					marked this trx to abort */
 #endif /* WITH_WSREP */
 
 	/** Pre-allocated record locks */
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index 30b1666b4ae..80d84756724 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -54,7 +54,9 @@ Created 12/19/1997 Heikki Tuuri
 #include "buf0lru.h"
 #include "srv0srv.h"
 #include "srv0mon.h"
-#include "ha_innodb.h" /* For wsrep_thd_skip_locking */
+#ifdef WITH_WSREP
+#include "mysql/service_wsrep.h" /* For wsrep_thd_skip_locking */
+#endif
 
 /* Maximum number of rows to prefetch; MySQL interface has another parameter */
 #define SEL_MAX_N_PREFETCH	16
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index a33eb1fa0f9..22b72a14304 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -451,7 +451,6 @@ trx_rollback_to_savepoint_for_mysql_low(
 	trx_mark_sql_stat_end(trx);
 
 	trx->op_info = "";
-	trx->lock.was_chosen_as_deadlock_victim = FALSE;
 #ifdef WITH_WSREP
 	trx->lock.was_chosen_as_wsrep_victim = FALSE;
 #endif
diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc
index 494c163ca9e..803a8e3f586 100644
--- a/storage/innobase/trx/trx0rseg.cc
+++ b/storage/innobase/trx/trx0rseg.cc
@@ -60,8 +60,8 @@ trx_rseg_update_wsrep_checkpoint(
 	long long xid_seqno = wsrep_xid_seqno(xid);
 	const byte* xid_uuid = wsrep_xid_uuid(xid);
 
-	if (!memcmp(xid_uuid, wsrep_uuid, sizeof wsrep_uuid) &&
-	    xid_seqno != -1) {
+	if (xid_seqno != -1
+	    && !memcmp(xid_uuid, wsrep_uuid, sizeof wsrep_uuid)) {
 		ut_ad(xid_seqno > wsrep_seqno);
 	} else {
 		memcpy(wsrep_uuid, xid_uuid, sizeof wsrep_uuid);
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 91613f9f6cc..e5de832ed5f 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1441,7 +1441,6 @@ trx_commit_in_memory(
 
 	trx_mutex_enter(trx);
 	trx->dict_operation = TRX_DICT_OP_NONE;
-	trx->lock.was_chosen_as_deadlock_victim = FALSE;
 #ifdef WITH_WSREP
 	trx->lock.was_chosen_as_wsrep_victim = FALSE;
 #endif


More information about the commits mailing list