summaryrefslogtreecommitdiff
path: root/storage/xtradb
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb')
-rw-r--r--storage/xtradb/handler/ha_innodb.cc50
-rw-r--r--storage/xtradb/handler/ha_innodb.h15
-rw-r--r--storage/xtradb/include/ha_prototypes.h8
-rw-r--r--storage/xtradb/lock/lock0lock.cc7
-rw-r--r--storage/xtradb/lock/lock0wait.cc2
-rw-r--r--storage/xtradb/row/row0upd.cc5
-rw-r--r--storage/xtradb/srv/srv0conc.cc7
-rw-r--r--storage/xtradb/trx/trx0roll.cc2
-rw-r--r--storage/xtradb/trx/trx0sys.cc4
-rw-r--r--storage/xtradb/trx/trx0trx.cc4
10 files changed, 39 insertions, 65 deletions
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 76de9efe080..1355c8a22a1 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -117,6 +117,9 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "i_s.h"
#include "xtradb_i_s.h"
+#include <mysql/plugin.h>
+#include <mysql/service_wsrep.h>
+
# ifndef MYSQL_PLUGIN_IMPORT
# define MYSQL_PLUGIN_IMPORT /* nothing */
# endif /* MYSQL_PLUGIN_IMPORT */
@@ -141,13 +144,6 @@ wsrep_ws_handle(THD* thd, const trx_t* trx) {
(wsrep_trx_id_t)trx->id);
}
-extern bool wsrep_prepare_key_for_innodb(const uchar *cache_key,
- size_t cache_key_len,
- const uchar* row_id,
- size_t row_id_len,
- wsrep_buf_t* key,
- size_t* key_len);
-
extern handlerton * wsrep_hton;
extern TC_LOG* tc_log;
extern void wsrep_cleanup_transaction(THD *thd);
@@ -4136,7 +4132,7 @@ innobase_commit_low(
#ifdef WITH_WSREP
THD* thd = (THD*)trx->mysql_thd;
const char* tmp = 0;
- if (wsrep_on((void*)thd)) {
+ if (wsrep_on(thd)) {
#ifdef WSREP_PROC_INFO
char info[64];
info[sizeof(info) - 1] = '\0';
@@ -4155,7 +4151,7 @@ innobase_commit_low(
trx_commit_for_mysql(trx);
}
#ifdef WITH_WSREP
- if (wsrep_on((void*)thd)) { thd_proc_info(thd, tmp); }
+ if (wsrep_on(thd)) { thd_proc_info(thd, tmp); }
#endif /* WITH_WSREP */
}
@@ -4933,7 +4929,7 @@ innobase_kill_connection(
#ifdef WITH_WSREP
wsrep_thd_LOCK(thd);
- if (wsrep_thd_conflict_state(thd) != NO_CONFLICT) {
+ if (wsrep_thd_get_conflict_state(thd) != NO_CONFLICT) {
/* if victim has been signaled by BF thread and/or aborting
is already progressing, following query aborting is not necessary
any more.
@@ -10250,7 +10246,7 @@ wsrep_append_foreign_key(
wsrep_buf_t wkey_part[3];
wsrep_key_t wkey = {wkey_part, 3};
- if (!wsrep_prepare_key_for_innodb(
+ if (!wsrep_prepare_key(
(const uchar*)cache_key,
cache_key_len + 1,
(const uchar*)key, len+1,
@@ -10296,7 +10292,7 @@ wsrep_append_key(
#ifdef WSREP_DEBUG_PRINT
fprintf(stderr, "%s conn %ld, trx %lu, keylen %d, table %s ",
(shared) ? "Shared" : "Exclusive",
- wsrep_thd_thread_id(thd), (long long)trx->id, key_len,
+ thd_get_thread_id(thd), (long long)trx->id, key_len,
table_share->table_name.str);
for (int i=0; i<key_len; i++) {
fprintf(stderr, "%hhX, ", key[i]);
@@ -10305,7 +10301,7 @@ wsrep_append_key(
#endif
wsrep_buf_t wkey_part[3];
wsrep_key_t wkey = {wkey_part, 3};
- if (!wsrep_prepare_key_for_innodb(
+ if (!wsrep_prepare_key(
(const uchar*)table_share->table_cache_key.str,
table_share->table_cache_key.length,
(const uchar*)key, key_len,
@@ -10353,7 +10349,7 @@ ha_innobase::wsrep_append_keys(
if (table_share && table_share->tmp_table != NO_TMP_TABLE) {
WSREP_DEBUG("skipping tmp table DML: THD: %lu tmp: %d SQL: %s",
- wsrep_thd_thread_id(thd),
+ thd_get_thread_id(thd),
table_share->tmp_table,
(wsrep_thd_query(thd)) ?
wsrep_thd_query(thd) : "void");
@@ -18444,7 +18440,7 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %lu",
signal, (long long)bf_seqno,
- wsrep_thd_thread_id(thd),
+ thd_get_thread_id(thd),
victim_trx->id);
WSREP_DEBUG("Aborting query: %s",
@@ -18460,10 +18456,10 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) {
WSREP_DEBUG("withdraw for BF trx: %lu, state: %d",
victim_trx->id,
- wsrep_thd_conflict_state(thd));
+ wsrep_thd_get_conflict_state(thd));
}
- switch (wsrep_thd_conflict_state(thd)) {
+ switch (wsrep_thd_get_conflict_state(thd)) {
case NO_CONFLICT:
wsrep_thd_set_conflict_state(thd, MUST_ABORT);
break;
@@ -18478,7 +18474,7 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
case ABORTING: // fall through
default:
WSREP_DEBUG("victim %lu in state %d",
- victim_trx->id, wsrep_thd_conflict_state(thd));
+ victim_trx->id, wsrep_thd_get_conflict_state(thd));
wsrep_thd_UNLOCK(thd);
DBUG_RETURN(0);
break;
@@ -18489,7 +18485,7 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
enum wsrep_status rcode;
WSREP_DEBUG("kill query for: %ld",
- wsrep_thd_thread_id(thd));
+ thd_get_thread_id(thd));
WSREP_DEBUG("kill trx QUERY_COMMITTING for %lu",
victim_trx->id);
@@ -18537,7 +18533,7 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
victim_trx->lock.was_chosen_as_deadlock_victim= TRUE;
if (victim_trx->lock.wait_lock) {
WSREP_DEBUG("victim has wait flag: %ld",
- wsrep_thd_thread_id(thd));
+ thd_get_thread_id(thd));
lock_t* wait_lock = victim_trx->lock.wait_lock;
if (wait_lock) {
WSREP_DEBUG("canceling wait lock");
@@ -18550,9 +18546,9 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
} else {
/* abort currently executing query */
DBUG_PRINT("wsrep",("sending KILL_QUERY to: %ld",
- wsrep_thd_thread_id(thd)));
+ thd_get_thread_id(thd)));
WSREP_DEBUG("kill query for: %ld",
- wsrep_thd_thread_id(thd));
+ thd_get_thread_id(thd));
/* Note that innobase_kill_connection will take lock_mutex
and trx_mutex */
wsrep_thd_UNLOCK(thd);
@@ -18591,7 +18587,7 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
if (abortees->aborting_thd == thd) {
skip_abort = true;
WSREP_WARN("duplicate thd aborter %lu",
- wsrep_thd_thread_id(thd));
+ thd_get_thread_id(thd));
}
abortees = abortees->next;
}
@@ -18602,10 +18598,10 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
aborting->aborting_thd = thd;
aborting->next = wsrep_aborting_thd;
wsrep_aborting_thd = aborting;
- DBUG_PRINT("wsrep",("enqueuing trx abort for %lu",
- wsrep_thd_thread_id(thd)));
+ DBUG_PRINT("wsrep",("enqueuing trx abort for %lu",
+ thd_get_thread_id(thd)));
WSREP_DEBUG("enqueuing trx abort for (%lu)",
- wsrep_thd_thread_id(thd));
+ thd_get_thread_id(thd));
}
DBUG_PRINT("wsrep",("signalling wsrep rollbacker"));
@@ -18660,7 +18656,7 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd,
static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid)
{
DBUG_ASSERT(hton == innodb_hton_ptr);
- if (wsrep_is_wsrep_xid((const void *)xid)) {
+ if (wsrep_is_wsrep_xid(xid)) {
mtr_t mtr;
mtr_start(&mtr);
trx_sysf_t* sys_header = trx_sysf_get(&mtr);
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index d6a1b738fe7..0c76c286030 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -487,33 +487,18 @@ struct trx_t;
extern "C" bool wsrep_thd_is_wsrep_on(THD *thd);
-extern "C" enum wsrep_exec_mode wsrep_thd_exec_mode(THD *thd);
-extern "C" enum wsrep_conflict_state wsrep_thd_conflict_state(THD *thd);
-extern "C" enum wsrep_query_state wsrep_thd_query_state(THD *thd);
-extern "C" const char * wsrep_thd_exec_mode_str(THD *thd);
-extern "C" const char * wsrep_thd_conflict_state_str(THD *thd);
-extern "C" const char * wsrep_thd_query_state_str(THD *thd);
-extern "C" wsrep_ws_handle_t* wsrep_thd_ws_handle(THD *thd);
extern "C" void wsrep_thd_set_exec_mode(THD *thd, enum wsrep_exec_mode mode);
extern "C" void wsrep_thd_set_query_state(
THD *thd, enum wsrep_query_state state);
-extern "C" void wsrep_thd_set_conflict_state(
- THD *thd, enum wsrep_conflict_state state);
extern "C" void wsrep_thd_set_trx_to_replay(THD *thd, uint64 trx_id);
-extern "C"void wsrep_thd_LOCK(THD *thd);
-extern "C"void wsrep_thd_UNLOCK(THD *thd);
extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd);
extern "C" time_t wsrep_thd_query_start(THD *thd);
-extern "C" my_thread_id wsrep_thd_thread_id(THD *thd);
-extern "C" int64_t wsrep_thd_trx_seqno(THD *thd);
extern "C" query_id_t wsrep_thd_query_id(THD *thd);
-extern "C" char * wsrep_thd_query(THD *thd);
extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd);
extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id);
-extern "C" void wsrep_thd_awake(THD* thd, my_bool signal);
#endif
extern const struct _ft_vft ft_vft_result;
diff --git a/storage/xtradb/include/ha_prototypes.h b/storage/xtradb/include/ha_prototypes.h
index 4ebaee3c89e..f038b307a6e 100644
--- a/storage/xtradb/include/ha_prototypes.h
+++ b/storage/xtradb/include/ha_prototypes.h
@@ -290,17 +290,9 @@ UNIV_INTERN
int
wsrep_innobase_kill_one_trx(void *thd_ptr,
const trx_t *bf_trx, trx_t *victim_trx, ibool signal);
-my_bool wsrep_thd_set_PA_safe(void *thd_ptr, my_bool safe);
-int wsrep_thd_conflict_state(void *thd_ptr, my_bool sync);
-my_bool wsrep_thd_is_BF(void *thd_ptr, my_bool sync);
-my_bool wsrep_thd_is_wsrep(void *thd_ptr);
-int wsrep_trx_order_before(void *thd1, void *thd2);
int wsrep_innobase_mysql_sort(int mysql_type, uint charset_number,
unsigned char* str, unsigned int str_length,
unsigned int buf_length);
-int
-wsrep_on(void *thd_ptr);
-extern "C" int wsrep_is_wsrep_xid(const void*);
#endif /* WITH_WSREP */
/**********************************************************************//**
Determines the connection character set.
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc
index d308e04d07d..8cf77e1ec82 100644
--- a/storage/xtradb/lock/lock0lock.cc
+++ b/storage/xtradb/lock/lock0lock.cc
@@ -50,11 +50,8 @@ Created 5/7/1996 Heikki Tuuri
#include "dict0boot.h"
#include <set>
-#ifdef WITH_WSREP
-extern my_bool wsrep_debug;
-extern my_bool wsrep_log_conflicts;
-#include "ha_prototypes.h"
-#endif
+#include <mysql/service_wsrep.h>
+
/* Restricts the length of search we will do in the waits-for
graph of transactions */
#define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000
diff --git a/storage/xtradb/lock/lock0wait.cc b/storage/xtradb/lock/lock0wait.cc
index 388c847f580..77aa0261a0f 100644
--- a/storage/xtradb/lock/lock0wait.cc
+++ b/storage/xtradb/lock/lock0wait.cc
@@ -33,6 +33,8 @@ Created 25/5/2010 Sunny Bains
#include "ha_prototypes.h"
#include "lock0priv.h"
+#include <mysql/service_wsrep.h>
+
/*********************************************************************//**
Print the contents of the lock_sys_t::waiting_threads array. */
static
diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc
index bdd2a691368..a642f7932b7 100644
--- a/storage/xtradb/row/row0upd.cc
+++ b/storage/xtradb/row/row0upd.cc
@@ -53,10 +53,9 @@ Created 12/27/1996 Heikki Tuuri
#include "pars0sym.h"
#include "eval0eval.h"
#include "buf0lru.h"
-#ifdef WITH_WSREP
-extern my_bool wsrep_debug;
-#endif
+#include <mysql/plugin.h>
+#include <mysql/service_wsrep.h>
/* What kind of latch and lock can we assume when the control comes to
-------------------------------------------------------------------
diff --git a/storage/xtradb/srv/srv0conc.cc b/storage/xtradb/srv/srv0conc.cc
index 5868e4e012b..c4cf1b9ab7b 100644
--- a/storage/xtradb/srv/srv0conc.cc
+++ b/storage/xtradb/srv/srv0conc.cc
@@ -42,11 +42,8 @@ Created 2011/04/18 Sunny Bains
#include "btr0types.h"
#include "trx0trx.h"
-#include "mysql/plugin.h"
-#ifdef WITH_WSREP
-extern "C" int wsrep_trx_is_aborting(void *thd_ptr);
-extern my_bool wsrep_debug;
-#endif
+#include <mysql/plugin.h>
+#include <mysql/service_wsrep.h>
/** Number of times a thread is allowed to enter InnoDB within the same
SQL query after it has once got the ticket. */
diff --git a/storage/xtradb/trx/trx0roll.cc b/storage/xtradb/trx/trx0roll.cc
index eb2af877a6d..b349614badf 100644
--- a/storage/xtradb/trx/trx0roll.cc
+++ b/storage/xtradb/trx/trx0roll.cc
@@ -29,6 +29,8 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0roll.ic"
#endif
+#include <mysql/service_wsrep.h>
+
#include "fsp0fsp.h"
#include "mach0data.h"
#include "trx0rseg.h"
diff --git a/storage/xtradb/trx/trx0sys.cc b/storage/xtradb/trx/trx0sys.cc
index 19d14bf6f38..9b59ae14278 100644
--- a/storage/xtradb/trx/trx0sys.cc
+++ b/storage/xtradb/trx/trx0sys.cc
@@ -48,6 +48,8 @@ Created 3/26/1996 Heikki Tuuri
#include "ha_prototypes.h" /* wsrep_is_wsrep_xid() */
#endif /* */
+#include <mysql/service_wsrep.h>
+
/** The file format tag structure with id and name. */
struct file_format_t {
ulint id; /*!< id of the file format */
@@ -362,7 +364,7 @@ trx_sys_update_wsrep_checkpoint(
#endif /* UNIV_DEBUG */
ut_ad(xid && mtr);
- ut_a(xid->formatID == -1 || wsrep_is_wsrep_xid((const void *)xid));
+ ut_a(xid->formatID == -1 || wsrep_is_wsrep_xid(xid));
if (mach_read_from_4(sys_header + TRX_SYS_WSREP_XID_INFO
+ TRX_SYS_WSREP_XID_MAGIC_N_FLD)
diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc
index d26517637cd..30d4b7f6546 100644
--- a/storage/xtradb/trx/trx0trx.cc
+++ b/storage/xtradb/trx/trx0trx.cc
@@ -30,6 +30,8 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0trx.ic"
#endif
+#include <mysql/service_wsrep.h>
+
#include "trx0undo.h"
#include "trx0rseg.h"
#include "log0log.h"
@@ -1226,7 +1228,7 @@ trx_write_serialisation_history(
#ifdef WITH_WSREP
sys_header = trx_sysf_get(mtr);
/* Update latest MySQL wsrep XID in trx sys header. */
- if (wsrep_is_wsrep_xid((const void *)&trx->xid))
+ if (wsrep_is_wsrep_xid(&trx->xid))
{
trx_sys_update_wsrep_checkpoint(&trx->xid, sys_header, mtr);
}