diff options
-rw-r--r-- | cmake/wsrep.cmake | 1 | ||||
-rw-r--r-- | extra/mariabackup/CMakeLists.txt | 4 | ||||
-rw-r--r-- | extra/mariabackup/wsrep.cc | 4 | ||||
-rw-r--r-- | include/mysql/service_wsrep.h | 8 | ||||
-rw-r--r-- | sql/handler.cc | 9 | ||||
-rw-r--r-- | sql/wsrep_dummy.cc | 9 | ||||
-rw-r--r-- | sql/wsrep_mysqld.h | 1 | ||||
-rw-r--r-- | sql/wsrep_xid.cc | 2 | ||||
-rw-r--r-- | storage/innobase/trx/trx0rseg.cc | 6 |
9 files changed, 30 insertions, 14 deletions
diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake index 6208688ecfc..b5dc8b9f157 100644 --- a/cmake/wsrep.cmake +++ b/cmake/wsrep.cmake @@ -40,5 +40,4 @@ SET(WSREP_PROC_INFO ${WITH_WSREP}) IF(WITH_WSREP) SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}") - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/wsrep) ENDIF() diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt index 78188d2f8e8..f4ec59bbadc 100644 --- a/extra/mariabackup/CMakeLists.txt +++ b/extra/mariabackup/CMakeLists.txt @@ -40,6 +40,10 @@ IF(NOT HAVE_SYSTEM_REGEX) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/pcre) ENDIF() +IF(WITH_WSREP) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/wsrep) +ENDIF() + ADD_DEFINITIONS(-UMYSQL_SERVER) ######################################################################## # xtrabackup binary diff --git a/extra/mariabackup/wsrep.cc b/extra/mariabackup/wsrep.cc index dd3d5cb60d2..fac1fdcf583 100644 --- a/extra/mariabackup/wsrep.cc +++ b/extra/mariabackup/wsrep.cc @@ -49,6 +49,8 @@ permission notice: #include "common.h" #ifdef WITH_WSREP +#include <wsrep_api.h> + /*! Name of file where Galera info is stored on recovery */ #define XB_GALERA_INFO_FILENAME "xtrabackup_galera_info" @@ -62,7 +64,7 @@ xb_write_galera_info(bool incremental_prepare) FILE* fp; XID xid; char uuid_str[40]; - wsrep_seqno_t seqno; + long long seqno; MY_STAT statinfo; /* Do not overwrite existing an existing file to be compatible with diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h index d63003762a5..1540a5e56fe 100644 --- a/include/mysql/service_wsrep.h +++ b/include/mysql/service_wsrep.h @@ -22,8 +22,6 @@ For engines that want to support galera. */ -#include <wsrep_api.h> - #ifdef __cplusplus extern "C" { #endif @@ -69,7 +67,9 @@ enum wsrep_trx_status { }; struct xid_t; +struct wsrep; struct wsrep_ws_handle; +struct wsrep_buf; extern struct wsrep_service_st { struct wsrep * (*get_wsrep_func)(); @@ -84,7 +84,7 @@ extern struct wsrep_service_st { void (*wsrep_aborting_thd_enqueue_func)(THD *thd); bool (*wsrep_consistency_check_func)(THD *thd); int (*wsrep_is_wsrep_xid_func)(const struct xid_t *xid); - wsrep_seqno_t (*wsrep_xid_seqno_func)(const struct xid_t *xid); + long long (*wsrep_xid_seqno_func)(const struct xid_t *xid); const unsigned char* (*wsrep_xid_uuid_func)(const struct xid_t *xid); void (*wsrep_lock_rollback_func)(); int (*wsrep_on_func)(MYSQL_THD); @@ -186,7 +186,7 @@ enum wsrep_exec_mode wsrep_thd_exec_mode(THD *thd); enum wsrep_query_state wsrep_thd_query_state(THD *thd); enum wsrep_trx_status wsrep_run_wsrep_commit(THD *thd, bool all); int wsrep_is_wsrep_xid(const struct xid_t* xid); -wsrep_seqno_t wsrep_xid_seqno(const struct xid_t* xid); +long long wsrep_xid_seqno(const struct xid_t* xid); const unsigned char* wsrep_xid_uuid(const struct xid_t* xid); int wsrep_on(MYSQL_THD thd); int wsrep_thd_retry_counter(THD *thd); diff --git a/sql/handler.cc b/sql/handler.cc index 3d85d4d132c..7662d68e51f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1484,11 +1484,13 @@ int ha_commit_trans(THD *thd, bool all) DEBUG_SYNC(thd, "ha_commit_trans_after_prepare"); DBUG_EXECUTE_IF("crash_commit_after_prepare", DBUG_SUICIDE();); +#ifdef WITH_WSREP if (!error && WSREP_ON && wsrep_is_wsrep_xid(&thd->transaction.xid_state.xid)) { // xid was rewritten by wsrep xid= wsrep_xid_seqno(thd->transaction.xid_state.xid); } +#endif /* WITH_WSREP */ if (!is_real_trans) { @@ -1914,9 +1916,10 @@ static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin, got, hton_name(hton)->str); for (int i=0; i < got; i ++) { - my_xid x= WSREP_ON && wsrep_is_wsrep_xid(&info->list[i]) ? - wsrep_xid_seqno(info->list[i]) : - info->list[i].get_my_xid(); + my_xid x= IF_WSREP(WSREP_ON && wsrep_is_wsrep_xid(&info->list[i]) ? + wsrep_xid_seqno(info->list[i]) : + info->list[i].get_my_xid(), + info->list[i].get_my_xid()); if (!x) // not "mine" - that is generated by external TM { #ifndef DBUG_OFF diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc index c83f64e9cb4..0b6e7e0d5bb 100644 --- a/sql/wsrep_dummy.cc +++ b/sql/wsrep_dummy.cc @@ -29,6 +29,15 @@ enum wsrep_conflict_state wsrep_thd_conflict_state(THD *, my_bool) int wsrep_is_wsrep_xid(const XID*) { return 0; } +long long wsrep_xid_seqno(const XID* x) +{ return -1; } + +const unsigned char* wsrep_xid_uuid(const XID*) +{ + static const unsigned char uuid[16] = {0}; + return uuid; +} + bool wsrep_prepare_key(const uchar*, size_t, const uchar*, size_t, struct wsrep_buf*, size_t*) { return 0; } diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 6ad13cd6f6a..2cb35db01b7 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -328,7 +328,6 @@ bool wsrep_node_is_synced(); #define WSREP_FORMAT(my_format) ((ulong)my_format) #define WSREP_PROVIDER_EXISTS (0) #define wsrep_emulate_bin_log (0) -#define wsrep_xid_seqno(X) (0) #define wsrep_to_isolation (0) #define wsrep_init() (1) #define wsrep_prepend_PATH(X) diff --git a/sql/wsrep_xid.cc b/sql/wsrep_xid.cc index 04d48819397..618c98eade7 100644 --- a/sql/wsrep_xid.cc +++ b/sql/wsrep_xid.cc @@ -91,7 +91,7 @@ wsrep_seqno_t wsrep_xid_seqno(const XID& xid) return ret; } -wsrep_seqno_t wsrep_xid_seqno(const xid_t* xid) +long long wsrep_xid_seqno(const xid_t* xid) { DBUG_ASSERT(xid); return wsrep_xid_seqno(*xid); diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index eb970167a42..a1f2c2aec6e 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -39,7 +39,7 @@ Created 3/26/1996 Heikki Tuuri #ifdef UNIV_DEBUG /** The latest known WSREP XID sequence number */ -static wsrep_seqno_t wsrep_seqno = -1; +static long long wsrep_seqno = -1; #endif /* UNIV_DEBUG */ /** The latest known WSREP XID UUID */ static unsigned char wsrep_uuid[16]; @@ -58,7 +58,7 @@ trx_rseg_update_wsrep_checkpoint( #ifdef UNIV_DEBUG /* Check that seqno is monotonically increasing */ - wsrep_seqno_t xid_seqno = wsrep_xid_seqno(xid); + long long xid_seqno = wsrep_xid_seqno(xid); const byte* xid_uuid = wsrep_xid_uuid(xid); if (!memcmp(xid_uuid, wsrep_uuid, sizeof wsrep_uuid)) { @@ -227,7 +227,7 @@ bool trx_rseg_read_wsrep_checkpoint(XID& xid) } XID tmp_xid; - wsrep_seqno_t tmp_seqno = 0; + long long tmp_seqno = 0; if (trx_rseg_read_wsrep_checkpoint(rseg_header, tmp_xid) && (tmp_seqno = wsrep_xid_seqno(&tmp_xid)) > max_xid_seqno) { |