From 27d66d644cf2ebe9201e0362f2050036cce2908a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 3 Nov 2020 10:44:26 +0200 Subject: MENT-411 : Implement wsrep_replicate_aria Introduced two new wsrep_mode options * REPLICATE_MYISAM * REPLICATE_ARIA Depracated wsrep_replicate_myisam parameter and we use wsrep_mode = REPLICATE_MYISAM instead. This required small refactoring of wsrep_check_mode_after_open_table so that both MyISAM and Aria are handled on required DML cases. Similarly, added Aria to wsrep_should_replicate_ddl to handle DDL for Aria tables using TOI. Added test cases and improved MyISAM testing. Changed use of wsrep_replicate_myisam to wsrep_mode = REPLICATE_MYISAM --- sql/wsrep_mysqld.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sql/wsrep_mysqld.cc') diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index ea1582c5a44..21131b6b671 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1216,7 +1216,7 @@ static const char* wsrep_warning_name(const enum wsrep_warning_type type) return "WSREP_REQUIRE_PRIMARY_KEY"; break; case WSREP_REQUIRE_INNODB: return "WSREP_REQUIRE_INNODB"; break; - default: assert(0); + default: assert(0); return " "; break; // for compiler } } /** @@ -1373,7 +1373,8 @@ bool wsrep_check_mode_after_open_table (THD *thd, return true; const legacy_db_type db_type= hton->db_type; - bool replicate= (wsrep_replicate_myisam && db_type == DB_TYPE_MYISAM); + bool replicate= ((db_type == DB_TYPE_MYISAM && wsrep_check_mode(WSREP_MODE_REPLICATE_MYISAM)) || + (db_type == DB_TYPE_ARIA && wsrep_check_mode(WSREP_MODE_REPLICATE_ARIA))); TABLE *tbl= tables->table; if (replicate) @@ -1383,7 +1384,7 @@ bool wsrep_check_mode_after_open_table (THD *thd, Following code will kick-start the TOI but this has to be done only once per statement. Note: kick-start will take-care of creating isolation key for all tables - involved in the list (provided all of them are MYISAM tables). */ + involved in the list (provided all of them are MYISAM or Aria tables). */ if (!is_stat_table(&tables->db, &tables->alias)) { if (tbl->s->primary_key == MAX_KEY && @@ -2183,14 +2184,17 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton) return true; break; case DB_TYPE_MYISAM: - if (wsrep_replicate_myisam) + if (wsrep_check_mode(WSREP_MODE_REPLICATE_MYISAM)) return true; else WSREP_DEBUG("wsrep OSU failed for %s", wsrep_thd_query(thd)); break; case DB_TYPE_ARIA: - /* if (wsrep_replicate_aria) */ - /* fallthrough */ + if (wsrep_check_mode(WSREP_MODE_REPLICATE_ARIA)) + return true; + else + WSREP_DEBUG("wsrep OSU failed for %s", wsrep_thd_query(thd)); + break; default: WSREP_DEBUG("wsrep OSU failed for %s", wsrep_thd_query(thd)); break; -- cgit v1.2.1