-
Venkatesh Duggirala authored
WL#7057: MAKE --REPLICATION-* FILTER SETTINGS DYNAMIC Problem: The slave options --replicate-* are not dynamic. Hence these options cannot be changed while the server is running. Fix: Introduced "CHANGE REPLICATION FILTER" command which enables users to modify replication filtering rules without having to stop and restart the server. This is accomplished by just stopping the sql thread alone when these options are set dynamically. Since filtering rules are only used by the slave SQL thread, setting them while the thread is not running avoids the need for locking. Eg: CHANGE REPLICATION FILTER REPLICATE_DO_DB=(db1,db2,`db3`); CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB=(db1,db2,`db3`); CHANGE REPLICATION FILTER REPLICATE_DO_TABLE=(db1.t1); CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE=(db1.t1); CHANGE REPLICATION FILTER REPLICATE_WILD_DO_TABLE=('db.t%'); CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE=('db.t%'); CHANGE REPLICATION FILTER REPLICATE_REWRITE_DB=((db1,db2), (from_db, to_db)); Following are the few behavioral points about the command: a) Users should be able to set multiple filter rules in one command like CHANGE REPLICATION FILTER REPLICATE_DO_DB=(db1), REPLICATE_IGNORE_TABLE=(db1.t1), ..; b) To reset the filter value, they have to use void brackets "()" syntax, i.e, empty list will clear the existing values and set it to an empty value For example: CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE = (); c) The non-empty list filter rules will clear the existing values and set the value to new list. CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE = (db1.t1); will reset all existing values and set it the rule to db1.t1 value. d) Unspecified filter rules will be unchanged. For example: CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE = (db1.t1); will change REPLICATION_IGNORE_TABLE rule only and rest of the filter rules will not be changed and existing values will be continued. e) If some rule is specified multiple times, the latter list will be considered and the earlier list will be ignored. For example: CHANGE REPLICATION FILTER REPLICATION_DO_DB=(db1,db2), REPLICATE_DO_DB=(db3,db4); db1 and db2 list will be ignored and REPLICATE_DO_DB list will be updated with db3 and db4 values. f) In case of OUT OF MEMORY error, the command might get executed partially i.e., few of the filter rules might get executed and few of them might not get executed. User needs to verify them manually to see which ones are executed.
Venkatesh Duggirala authoredWL#7057: MAKE --REPLICATION-* FILTER SETTINGS DYNAMIC Problem: The slave options --replicate-* are not dynamic. Hence these options cannot be changed while the server is running. Fix: Introduced "CHANGE REPLICATION FILTER" command which enables users to modify replication filtering rules without having to stop and restart the server. This is accomplished by just stopping the sql thread alone when these options are set dynamically. Since filtering rules are only used by the slave SQL thread, setting them while the thread is not running avoids the need for locking. Eg: CHANGE REPLICATION FILTER REPLICATE_DO_DB=(db1,db2,`db3`); CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB=(db1,db2,`db3`); CHANGE REPLICATION FILTER REPLICATE_DO_TABLE=(db1.t1); CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE=(db1.t1); CHANGE REPLICATION FILTER REPLICATE_WILD_DO_TABLE=('db.t%'); CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE=('db.t%'); CHANGE REPLICATION FILTER REPLICATE_REWRITE_DB=((db1,db2), (from_db, to_db)); Following are the few behavioral points about the command: a) Users should be able to set multiple filter rules in one command like CHANGE REPLICATION FILTER REPLICATE_DO_DB=(db1), REPLICATE_IGNORE_TABLE=(db1.t1), ..; b) To reset the filter value, they have to use void brackets "()" syntax, i.e, empty list will clear the existing values and set it to an empty value For example: CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE = (); c) The non-empty list filter rules will clear the existing values and set the value to new list. CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE = (db1.t1); will reset all existing values and set it the rule to db1.t1 value. d) Unspecified filter rules will be unchanged. For example: CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE = (db1.t1); will change REPLICATION_IGNORE_TABLE rule only and rest of the filter rules will not be changed and existing values will be continued. e) If some rule is specified multiple times, the latter list will be considered and the earlier list will be ignored. For example: CHANGE REPLICATION FILTER REPLICATION_DO_DB=(db1,db2), REPLICATE_DO_DB=(db3,db4); db1 and db2 list will be ignored and REPLICATE_DO_DB list will be updated with db3 and db4 values. f) In case of OUT OF MEMORY error, the command might get executed partially i.e., few of the filter rules might get executed and few of them might not get executed. User needs to verify them manually to see which ones are executed.
Loading