Browse Source
Reduce compilation dependencies on wsrep_mysqld.h
Reduce compilation dependencies on wsrep_mysqld.h
Making changes to wsrep_mysqld.h causes large parts of server code to be recompiled. The reason is that wsrep_mysqld.h is included by sql_class.h, even tough very little of wsrep_mysqld.h is needed in sql_class.h. This commit introduces a new header file, wsrep_on.h, which is meant to be included from sql_class.h, and contains only macros and variable declarations used to determine whether wsrep is enabled. Also, header wsrep.h should only contain definitions that are also used outside of sql/. Therefore, move WSREP_TO_ISOLATION* and WSREP_SYNC_WAIT macros to wsrep_mysqld.h. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>pull/2254/head
committed by
Jan Lindström
40 changed files with 188 additions and 131 deletions
-
59include/wsrep.h
-
4sql/backup.cc
-
1sql/event_data_objects.cc
-
1sql/events.cc
-
3sql/item_func.cc
-
2sql/item_strfunc.cc
-
3sql/lock.cc
-
1sql/log.h
-
4sql/log_event.cc
-
3sql/mdl.cc
-
1sql/mysqld.cc
-
1sql/sp_head.cc
-
1sql/sql_acl.cc
-
3sql/sql_cache.cc
-
1sql/sql_class.cc
-
8sql/sql_class.h
-
3sql/sql_lex.cc
-
1sql/sql_partition_admin.cc
-
1sql/sql_plugin.cc
-
3sql/sql_reload.cc
-
3sql/sql_sequence.cc
-
3sql/sql_table.cc
-
3sql/sql_trigger.cc
-
1sql/sql_view.cc
-
3sql/sys_vars.cc
-
2sql/wsrep_binlog.cc
-
1sql/wsrep_check_opts.cc
-
1sql/wsrep_client_service.cc
-
1sql/wsrep_high_priority_service.cc
-
107sql/wsrep_mysqld.h
-
63sql/wsrep_on.h
-
10sql/wsrep_priv.h
-
1sql/wsrep_schema.cc
-
1sql/wsrep_sst.cc
-
1sql/wsrep_thd.cc
-
1sql/wsrep_var.cc
-
1storage/innobase/dict/dict0stats_bg.cc
-
3storage/innobase/handler/ha_innodb.h
-
3storage/innobase/row/row0ins.cc
-
6storage/innobase/row/row0mysql.cc
@ -0,0 +1,63 @@ |
|||
/* Copyright 2022 Codership Oy <http://www.codership.com> |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; version 2 of the License. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ |
|||
|
|||
#ifndef WSREP_ON_H |
|||
#define WSREP_ON_H |
|||
|
|||
#ifdef WITH_WSREP |
|||
|
|||
extern bool WSREP_ON_; |
|||
extern bool WSREP_PROVIDER_EXISTS_; |
|||
extern my_bool wsrep_emulate_bin_log; |
|||
extern ulong wsrep_forced_binlog_format; |
|||
|
|||
#define WSREP_ON unlikely(WSREP_ON_) |
|||
|
|||
/* use xxxxxx_NNULL macros when thd pointer is guaranteed to be non-null to |
|||
* avoid compiler warnings (GCC 6 and later) */ |
|||
|
|||
#define WSREP_NNULL(thd) \ |
|||
(WSREP_PROVIDER_EXISTS_ && thd->variables.wsrep_on) |
|||
|
|||
#define WSREP(thd) \ |
|||
(thd && WSREP_NNULL(thd)) |
|||
|
|||
#define WSREP_CLIENT_NNULL(thd) \ |
|||
(WSREP_NNULL(thd) && thd->wsrep_client_thread) |
|||
|
|||
#define WSREP_CLIENT(thd) \ |
|||
(WSREP(thd) && thd->wsrep_client_thread) |
|||
|
|||
#define WSREP_EMULATE_BINLOG_NNULL(thd) \ |
|||
(WSREP_NNULL(thd) && wsrep_emulate_bin_log) |
|||
|
|||
#define WSREP_EMULATE_BINLOG(thd) \ |
|||
(WSREP(thd) && wsrep_emulate_bin_log) |
|||
|
|||
#define WSREP_BINLOG_FORMAT(my_format) \ |
|||
((wsrep_forced_binlog_format != BINLOG_FORMAT_UNSPEC) ? \ |
|||
wsrep_forced_binlog_format : my_format) |
|||
|
|||
#else |
|||
|
|||
#define WSREP_ON false |
|||
#define WSREP(T) (0) |
|||
#define WSREP_NNULL(T) (0) |
|||
#define WSREP_EMULATE_BINLOG(thd) (0) |
|||
#define WSREP_EMULATE_BINLOG_NNULL(thd) (0) |
|||
#define WSREP_BINLOG_FORMAT(my_format) ((ulong)my_format) |
|||
|
|||
#endif |
|||
#endif |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue