mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-15505 Fixes to compilation without -DWITH_WSREP:BOOL=ON
Removed including wsrep_api.h from service_wsrep.h. This caused various kinds of collisions with definitions when wsrep is not supposed to be built in. Defined functions wsrep_xid_seqno() and wsrep_xid_uuid() in wsrep_dummy.cc. Replaced wsrep_seqno_t with long long where wsrep_api.h is not included. Removed wsrep_xid_seqno() macro from wsrep_mysqld.h and made wsrep code using wsrep_xid_seqno() in handler.cc to be compiled in only if WITH_WSREP is ON. Included wsrep_api.h for mariabackup if WITH_WSREP is ON.
This commit is contained in:
@@ -40,5 +40,4 @@ SET(WSREP_PROC_INFO ${WITH_WSREP})
|
|||||||
|
|
||||||
IF(WITH_WSREP)
|
IF(WITH_WSREP)
|
||||||
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
|
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/wsrep)
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@@ -40,6 +40,10 @@ IF(NOT HAVE_SYSTEM_REGEX)
|
|||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/pcre)
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/pcre)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_WSREP)
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/wsrep)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
ADD_DEFINITIONS(-UMYSQL_SERVER)
|
ADD_DEFINITIONS(-UMYSQL_SERVER)
|
||||||
########################################################################
|
########################################################################
|
||||||
# xtrabackup binary
|
# xtrabackup binary
|
||||||
|
@@ -49,6 +49,8 @@ permission notice:
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#ifdef WITH_WSREP
|
#ifdef WITH_WSREP
|
||||||
|
|
||||||
|
#include <wsrep_api.h>
|
||||||
|
|
||||||
/*! Name of file where Galera info is stored on recovery */
|
/*! Name of file where Galera info is stored on recovery */
|
||||||
#define XB_GALERA_INFO_FILENAME "xtrabackup_galera_info"
|
#define XB_GALERA_INFO_FILENAME "xtrabackup_galera_info"
|
||||||
|
|
||||||
@@ -62,7 +64,7 @@ xb_write_galera_info(bool incremental_prepare)
|
|||||||
FILE* fp;
|
FILE* fp;
|
||||||
XID xid;
|
XID xid;
|
||||||
char uuid_str[40];
|
char uuid_str[40];
|
||||||
wsrep_seqno_t seqno;
|
long long seqno;
|
||||||
MY_STAT statinfo;
|
MY_STAT statinfo;
|
||||||
|
|
||||||
/* Do not overwrite existing an existing file to be compatible with
|
/* Do not overwrite existing an existing file to be compatible with
|
||||||
|
@@ -22,8 +22,6 @@
|
|||||||
For engines that want to support galera.
|
For engines that want to support galera.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <wsrep_api.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -69,7 +67,9 @@ enum wsrep_trx_status {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct xid_t;
|
struct xid_t;
|
||||||
|
struct wsrep;
|
||||||
struct wsrep_ws_handle;
|
struct wsrep_ws_handle;
|
||||||
|
struct wsrep_buf;
|
||||||
|
|
||||||
extern struct wsrep_service_st {
|
extern struct wsrep_service_st {
|
||||||
struct wsrep * (*get_wsrep_func)();
|
struct wsrep * (*get_wsrep_func)();
|
||||||
@@ -84,7 +84,7 @@ extern struct wsrep_service_st {
|
|||||||
void (*wsrep_aborting_thd_enqueue_func)(THD *thd);
|
void (*wsrep_aborting_thd_enqueue_func)(THD *thd);
|
||||||
bool (*wsrep_consistency_check_func)(THD *thd);
|
bool (*wsrep_consistency_check_func)(THD *thd);
|
||||||
int (*wsrep_is_wsrep_xid_func)(const struct xid_t *xid);
|
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);
|
const unsigned char* (*wsrep_xid_uuid_func)(const struct xid_t *xid);
|
||||||
void (*wsrep_lock_rollback_func)();
|
void (*wsrep_lock_rollback_func)();
|
||||||
int (*wsrep_on_func)(MYSQL_THD);
|
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_query_state wsrep_thd_query_state(THD *thd);
|
||||||
enum wsrep_trx_status wsrep_run_wsrep_commit(THD *thd, bool all);
|
enum wsrep_trx_status wsrep_run_wsrep_commit(THD *thd, bool all);
|
||||||
int wsrep_is_wsrep_xid(const struct xid_t* xid);
|
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);
|
const unsigned char* wsrep_xid_uuid(const struct xid_t* xid);
|
||||||
int wsrep_on(MYSQL_THD thd);
|
int wsrep_on(MYSQL_THD thd);
|
||||||
int wsrep_thd_retry_counter(THD *thd);
|
int wsrep_thd_retry_counter(THD *thd);
|
||||||
|
@@ -1484,11 +1484,13 @@ int ha_commit_trans(THD *thd, bool all)
|
|||||||
DEBUG_SYNC(thd, "ha_commit_trans_after_prepare");
|
DEBUG_SYNC(thd, "ha_commit_trans_after_prepare");
|
||||||
DBUG_EXECUTE_IF("crash_commit_after_prepare", DBUG_SUICIDE(););
|
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))
|
if (!error && WSREP_ON && wsrep_is_wsrep_xid(&thd->transaction.xid_state.xid))
|
||||||
{
|
{
|
||||||
// xid was rewritten by wsrep
|
// xid was rewritten by wsrep
|
||||||
xid= wsrep_xid_seqno(thd->transaction.xid_state.xid);
|
xid= wsrep_xid_seqno(thd->transaction.xid_state.xid);
|
||||||
}
|
}
|
||||||
|
#endif /* WITH_WSREP */
|
||||||
|
|
||||||
if (!is_real_trans)
|
if (!is_real_trans)
|
||||||
{
|
{
|
||||||
@@ -1914,9 +1916,10 @@ static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin,
|
|||||||
got, hton_name(hton)->str);
|
got, hton_name(hton)->str);
|
||||||
for (int i=0; i < got; i ++)
|
for (int i=0; i < got; i ++)
|
||||||
{
|
{
|
||||||
my_xid x= WSREP_ON && wsrep_is_wsrep_xid(&info->list[i]) ?
|
my_xid x= IF_WSREP(WSREP_ON && wsrep_is_wsrep_xid(&info->list[i]) ?
|
||||||
wsrep_xid_seqno(info->list[i]) :
|
wsrep_xid_seqno(info->list[i]) :
|
||||||
info->list[i].get_my_xid();
|
info->list[i].get_my_xid(),
|
||||||
|
info->list[i].get_my_xid());
|
||||||
if (!x) // not "mine" - that is generated by external TM
|
if (!x) // not "mine" - that is generated by external TM
|
||||||
{
|
{
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
|
@@ -29,6 +29,15 @@ enum wsrep_conflict_state wsrep_thd_conflict_state(THD *, my_bool)
|
|||||||
int wsrep_is_wsrep_xid(const XID*)
|
int wsrep_is_wsrep_xid(const XID*)
|
||||||
{ return 0; }
|
{ 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*)
|
bool wsrep_prepare_key(const uchar*, size_t, const uchar*, size_t, struct wsrep_buf*, size_t*)
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
|
|
||||||
|
@@ -328,7 +328,6 @@ bool wsrep_node_is_synced();
|
|||||||
#define WSREP_FORMAT(my_format) ((ulong)my_format)
|
#define WSREP_FORMAT(my_format) ((ulong)my_format)
|
||||||
#define WSREP_PROVIDER_EXISTS (0)
|
#define WSREP_PROVIDER_EXISTS (0)
|
||||||
#define wsrep_emulate_bin_log (0)
|
#define wsrep_emulate_bin_log (0)
|
||||||
#define wsrep_xid_seqno(X) (0)
|
|
||||||
#define wsrep_to_isolation (0)
|
#define wsrep_to_isolation (0)
|
||||||
#define wsrep_init() (1)
|
#define wsrep_init() (1)
|
||||||
#define wsrep_prepend_PATH(X)
|
#define wsrep_prepend_PATH(X)
|
||||||
|
@@ -91,7 +91,7 @@ wsrep_seqno_t wsrep_xid_seqno(const XID& xid)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
wsrep_seqno_t wsrep_xid_seqno(const xid_t* xid)
|
long long wsrep_xid_seqno(const xid_t* xid)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(xid);
|
DBUG_ASSERT(xid);
|
||||||
return wsrep_xid_seqno(*xid);
|
return wsrep_xid_seqno(*xid);
|
||||||
|
@@ -39,7 +39,7 @@ Created 3/26/1996 Heikki Tuuri
|
|||||||
|
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
/** The latest known WSREP XID sequence number */
|
/** The latest known WSREP XID sequence number */
|
||||||
static wsrep_seqno_t wsrep_seqno = -1;
|
static long long wsrep_seqno = -1;
|
||||||
#endif /* UNIV_DEBUG */
|
#endif /* UNIV_DEBUG */
|
||||||
/** The latest known WSREP XID UUID */
|
/** The latest known WSREP XID UUID */
|
||||||
static unsigned char wsrep_uuid[16];
|
static unsigned char wsrep_uuid[16];
|
||||||
@@ -58,7 +58,7 @@ trx_rseg_update_wsrep_checkpoint(
|
|||||||
|
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
/* Check that seqno is monotonically increasing */
|
/* 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);
|
const byte* xid_uuid = wsrep_xid_uuid(xid);
|
||||||
|
|
||||||
if (!memcmp(xid_uuid, wsrep_uuid, sizeof wsrep_uuid)) {
|
if (!memcmp(xid_uuid, wsrep_uuid, sizeof wsrep_uuid)) {
|
||||||
@@ -227,7 +227,7 @@ bool trx_rseg_read_wsrep_checkpoint(XID& xid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
XID tmp_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)
|
if (trx_rseg_read_wsrep_checkpoint(rseg_header, tmp_xid)
|
||||||
&& (tmp_seqno = wsrep_xid_seqno(&tmp_xid))
|
&& (tmp_seqno = wsrep_xid_seqno(&tmp_xid))
|
||||||
> max_xid_seqno) {
|
> max_xid_seqno) {
|
||||||
|
Reference in New Issue
Block a user