diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2020-04-21 13:46:05 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2020-04-24 13:12:46 +0300 |
commit | 93475aff8de80a0ef53cbee924bcb70de6e86f2c (patch) | |
tree | 2f4c902df61d26323495d498e34aa52265508c2b /sql/wsrep_mysqld.cc | |
parent | 9398c3dfa5f8c2b2b5bc51dbf079e3edd343ae9e (diff) | |
download | mariadb-git-93475aff8de80a0ef53cbee924bcb70de6e86f2c.tar.gz |
MDEV-22203: WSREP_ON is unnecessarily expensive to evaluate
Replaced WSREP_ON macro by single global variable WSREP_ON
that is then updated at server statup and on wsrep_on and
wsrep_provider update functions.
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r-- | sql/wsrep_mysqld.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 90896b2319e..c1a289cf685 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -732,6 +732,7 @@ void wsrep_init_globals() { wsrep_init_sidno(Wsrep_server_state::instance().connected_gtid().id()); wsrep_init_schema(); + if (WSREP_ON) { Wsrep_server_state::instance().initialized(); @@ -769,6 +770,11 @@ int wsrep_init() global_system_variables.wsrep_on= 1; + if (wsrep_provider && strcmp(wsrep_provider, WSREP_NONE)) + WSREP_ON= true; + else + WSREP_ON= false; + if (wsrep_gtid_mode && opt_bin_log && !opt_log_slave_updates) { WSREP_ERROR("Option --log-slave-updates is required if " |