Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @@ -206,11 +206,19 @@ extern Binlog_relay_IO_delegate *binlog_relay_io_delegate;
- #endif /* HAVE_REPLICATION */
- /*
- - if there is no observers in the delegate, we can return 0
- - immediately.
- + if semisync replication is not enabled, we can return immediately.
- */
- -#define RUN_HOOK(group, hook, args) \
- - (group ##_delegate->is_empty() ? \
- - 0 : group ##_delegate->hook args)
- +#ifdef HAVE_REPLICATION
- +/*
- + As semisync is unpluggined and its hooks are turned into static
- + invocations all other hooks are not run for optimization sake.
- + Todo: introduce a server flag to allow the plugins' hooks to run
- + along with "static" semisync ones.
- +*/
- +#define RUN_HOOK(group, hook, args) \
- + (unlikely(run_hooks_enabled) ? group ##_delegate->hook args : 0)
- +#else
- +#define RUN_HOOK(group, hook, args) 0
- +#endif /* HAVE_REPLICATION */
- #endif /* RPL_HANDLER_H */
- @@ -8807,6 +8872,7 @@ static int mysql_init_variables(void)
- report_user= report_password = report_host= 0; /* TO BE DELETED */
- opt_relay_logname= opt_relaylog_index_name= 0;
- slave_retried_transactions= 0;
- + run_hooks_enabled= 1; // "dynamic" hooks run by default unlike "static" semisync
- log_bin_basename= NULL;
- log_bin_index= NULL;
- // SET @@global.rpl_semi_sync_master_enabled = ON
- @@ -388,6 +409,7 @@ int ReplSemiSyncMaster::enableMaster()
- set_master_enabled(true);
- state_ = true;
- + run_hooks_enabled= 0; // plugin "dynamic" hooks not to run when semisync ON
- sql_print_information("Semi-sync replication enabled on the master.");
- }
- else
- @@ -44,54 +48,72 @@ class ReplSemiSyncSlave
- return slave_enabled_;
- }
- void setSlaveEnabled(bool enabled) {
- + run_hooks_enabled= !enabled; // plugin "dynamic" hooks not to run when semisync ON
- slave_enabled_ = enabled;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement