diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2019-10-02 13:24:34 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2020-02-11 15:17:50 +0200 |
commit | e6a50e41da5e9e55031b978fba19a2b3ec4928b8 (patch) | |
tree | 1a0c544ca982ce3059d0f8107735051d311371a4 /sql/wsrep_mysqld.h | |
parent | 41541a7c48697cf139cee309211226dce1f21d72 (diff) | |
download | mariadb-git-e6a50e41da5e9e55031b978fba19a2b3ec4928b8.tar.gz |
MDEV-20051: Add new mode to wsrep_OSU_method in which Galera checks storage engine of the effected table
Introduced a new wsrep_strict_ddl configuration variable in which
Galera checks storage engine of the effected table. If table is not
InnoDB (only storage engine currently fully supporting Galera
replication) DDL-statement will return error code:
ER_GALERA_REPLICATION_NOT_SUPPORTED
eng "DDL-statement is forbidden as table storage engine does not support Galera replication"
However, when wsrep_replicate_myisam=ON we allow DDL-statements to
MyISAM tables. If effected table is allowed storage engine Galera
will run normal TOI.
This new setting should be for now set globally on all
nodes in a cluster. When this setting is set following DDL-clauses
accessing tables not supporting Galera replication are refused:
* CREATE TABLE (e.g. CREATE TABLE t1(a int) engine=Aria
* ALTER TABLE
* TRUNCATE TABLE
* CREATE VIEW
* CREATE TRIGGER
* CREATE INDEX
* DROP INDEX
* RENAME TABLE
* DROP TABLE
Statements on PROCEDURE, EVENT, FUNCTION are allowed as effected
tables are known only at execution. Furthermore, USER, ROLE, SERVER,
DATABASE statements are also allowed as they do not really have
effected table.
Diffstat (limited to 'sql/wsrep_mysqld.h')
-rw-r--r-- | sql/wsrep_mysqld.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 077e5602025..b51dc308646 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -98,6 +98,7 @@ extern ulong wsrep_running_applier_threads; extern ulong wsrep_running_rollbacker_threads; extern bool wsrep_new_cluster; extern bool wsrep_gtid_mode; +extern my_bool wsrep_strict_ddl; enum enum_wsrep_reject_types { WSREP_REJECT_NONE, /* nothing rejected */ @@ -108,7 +109,7 @@ enum enum_wsrep_reject_types { enum enum_wsrep_OSU_method { WSREP_OSU_TOI, WSREP_OSU_RSU, - WSREP_OSU_NONE, + WSREP_OSU_NONE }; enum enum_wsrep_sync_wait { @@ -360,9 +361,15 @@ extern PSI_thread_key key_wsrep_sst_donor_monitor; struct TABLE_LIST; class Alter_info; +struct HA_CREATE_INFO; + int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_, const TABLE_LIST* table_list, - Alter_info* alter_info= NULL); + const Alter_info* alter_info= NULL, + const HA_CREATE_INFO* create_info= NULL); + +bool wsrep_should_replicate_ddl(THD* thd, const enum legacy_db_type db_type); +bool wsrep_should_replicate_ddl_iterate(THD* thd, const TABLE_LIST* table_list); void wsrep_to_isolation_end(THD *thd); |