Commit 86551362 authored by Sergei Golubchik's avatar Sergei Golubchik

remove wsrep_hton dependency from innodb/xtradb

parent 4ce39dca
...@@ -80,7 +80,7 @@ extern struct wsrep_service_st { ...@@ -80,7 +80,7 @@ extern struct wsrep_service_st {
int (*wsrep_on_func)(MYSQL_THD); int (*wsrep_on_func)(MYSQL_THD);
void (*wsrep_post_commit_func)(THD* thd, bool all); void (*wsrep_post_commit_func)(THD* thd, bool all);
bool (*wsrep_prepare_key_func)(const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*); bool (*wsrep_prepare_key_func)(const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*);
enum wsrep_trx_status (*wsrep_run_wsrep_commit_func)(THD *thd, handlerton *hton, bool all); enum wsrep_trx_status (*wsrep_run_wsrep_commit_func)(THD *thd, bool all);
void (*wsrep_thd_LOCK_func)(THD *thd); void (*wsrep_thd_LOCK_func)(THD *thd);
void (*wsrep_thd_UNLOCK_func)(THD *thd); void (*wsrep_thd_UNLOCK_func)(THD *thd);
void (*wsrep_thd_awake_func)(THD *thd, my_bool signal); void (*wsrep_thd_awake_func)(THD *thd, my_bool signal);
...@@ -119,7 +119,7 @@ extern struct wsrep_service_st { ...@@ -119,7 +119,7 @@ extern struct wsrep_service_st {
#define wsrep_on(X) wsrep_service->wsrep_on_func(X) #define wsrep_on(X) wsrep_service->wsrep_on_func(X)
#define wsrep_post_commit(T,A) wsrep_service->wsrep_post_commit_func(T,A) #define wsrep_post_commit(T,A) wsrep_service->wsrep_post_commit_func(T,A)
#define wsrep_prepare_key(A,B,C,D,E,F) wsrep_service->wsrep_prepare_key_func(A,B,C,D,E,F) #define wsrep_prepare_key(A,B,C,D,E,F) wsrep_service->wsrep_prepare_key_func(A,B,C,D,E,F)
#define wsrep_run_wsrep_commit(T,H,A) wsrep_service->wsrep_run_wsrep_commit_func(T,H,A) #define wsrep_run_wsrep_commit(T,A) wsrep_service->wsrep_run_wsrep_commit_func(T,A)
#define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T) #define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T)
#define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T) #define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T)
#define wsrep_thd_awake(T,S) wsrep_service->wsrep_thd_awake_func(T,S) #define wsrep_thd_awake(T,S) wsrep_service->wsrep_thd_awake_func(T,S)
...@@ -167,7 +167,7 @@ enum wsrep_conflict_state wsrep_thd_conflict_state(MYSQL_THD thd, my_bool sync); ...@@ -167,7 +167,7 @@ enum wsrep_conflict_state wsrep_thd_conflict_state(MYSQL_THD thd, my_bool sync);
enum wsrep_conflict_state wsrep_thd_get_conflict_state(MYSQL_THD thd); enum wsrep_conflict_state wsrep_thd_get_conflict_state(MYSQL_THD thd);
enum wsrep_exec_mode wsrep_thd_exec_mode(THD *thd); 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, handlerton *hton, 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);
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);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define VERSION_thd_timezone 0x0100 #define VERSION_thd_timezone 0x0100
#define VERSION_my_sha1 0x0101 #define VERSION_my_sha1 0x0101
#define VERSION_my_md5 0x0100 #define VERSION_my_md5 0x0100
#define VERSION_wsrep 0x0100 #define VERSION_wsrep 0x0200
#define VERSION_logger 0x0100 #define VERSION_logger 0x0100
#define VERSION_thd_autoinc 0x0100 #define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100 #define VERSION_thd_error_context 0x0100
......
...@@ -71,7 +71,7 @@ int wsrep_on(THD *thd) ...@@ -71,7 +71,7 @@ int wsrep_on(THD *thd)
void wsrep_post_commit(THD*, bool) void wsrep_post_commit(THD*, bool)
{ } { }
enum wsrep_trx_status wsrep_run_wsrep_commit(THD *, handlerton *, bool) enum wsrep_trx_status wsrep_run_wsrep_commit(THD *, bool)
{ return WSREP_TRX_ERROR; } { return WSREP_TRX_ERROR; }
void wsrep_thd_LOCK(THD *) void wsrep_thd_LOCK(THD *)
......
...@@ -27,9 +27,6 @@ extern ulonglong thd_to_trx_id(THD *thd); ...@@ -27,9 +27,6 @@ extern ulonglong thd_to_trx_id(THD *thd);
extern "C" int thd_binlog_format(const MYSQL_THD thd); extern "C" int thd_binlog_format(const MYSQL_THD thd);
// todo: share interface with ha_innodb.c // todo: share interface with ha_innodb.c
enum wsrep_trx_status wsrep_run_wsrep_commit(THD *thd, handlerton *hton,
bool all);
/* /*
Cleanup after local transaction commit/rollback, replay or TOI. Cleanup after local transaction commit/rollback, replay or TOI.
*/ */
...@@ -157,7 +154,7 @@ static int wsrep_prepare(handlerton *hton, THD *thd, bool all) ...@@ -157,7 +154,7 @@ static int wsrep_prepare(handlerton *hton, THD *thd, bool all)
!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
(thd->variables.wsrep_on && !wsrep_trans_cache_is_empty(thd))) (thd->variables.wsrep_on && !wsrep_trans_cache_is_empty(thd)))
{ {
int res= wsrep_run_wsrep_commit(thd, hton, all); int res= wsrep_run_wsrep_commit(thd, all);
if (res != 0) if (res != 0)
{ {
if (res == WSREP_TRX_SIZE_EXCEEDED) if (res == WSREP_TRX_SIZE_EXCEEDED)
...@@ -281,20 +278,19 @@ extern Rpl_filter* binlog_filter; ...@@ -281,20 +278,19 @@ extern Rpl_filter* binlog_filter;
extern my_bool opt_log_slave_updates; extern my_bool opt_log_slave_updates;
enum wsrep_trx_status enum wsrep_trx_status
wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) wsrep_run_wsrep_commit(THD *thd, bool all)
{ {
int rcode= -1; int rcode= -1;
size_t data_len= 0; size_t data_len= 0;
IO_CACHE *cache; IO_CACHE *cache;
int replay_round= 0; int replay_round= 0;
DBUG_ENTER("wsrep_run_wsrep_commit");
if (thd->get_stmt_da()->is_error()) { if (thd->get_stmt_da()->is_error()) {
WSREP_ERROR("commit issue, error: %d %s", WSREP_ERROR("commit issue, error: %d %s",
thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message()); thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message());
} }
DBUG_ENTER("wsrep_run_wsrep_commit");
if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK); if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK);
if (thd->wsrep_exec_mode == REPL_RECV) { if (thd->wsrep_exec_mode == REPL_RECV) {
......
...@@ -7641,7 +7641,7 @@ no_commit: ...@@ -7641,7 +7641,7 @@ no_commit:
} else if (src_table == prebuilt->table) { } else if (src_table == prebuilt->table) {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd)) {
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
...@@ -7668,7 +7668,7 @@ no_commit: ...@@ -7668,7 +7668,7 @@ no_commit:
} else { } else {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd)) {
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
......
...@@ -145,7 +145,6 @@ wsrep_ws_handle(THD* thd, const trx_t* trx) { ...@@ -145,7 +145,6 @@ wsrep_ws_handle(THD* thd, const trx_t* trx) {
(wsrep_trx_id_t)trx->id); (wsrep_trx_id_t)trx->id);
} }
extern handlerton * wsrep_hton;
extern TC_LOG* tc_log; extern TC_LOG* tc_log;
extern void wsrep_cleanup_transaction(THD *thd); extern void wsrep_cleanup_transaction(THD *thd);
static int static int
...@@ -8102,7 +8101,7 @@ no_commit: ...@@ -8102,7 +8101,7 @@ no_commit:
} else if (src_table == prebuilt->table) { } else if (src_table == prebuilt->table) {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd)) {
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
...@@ -8129,7 +8128,7 @@ no_commit: ...@@ -8129,7 +8128,7 @@ no_commit:
} else { } else {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd)) {
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment