Skip to content

Commit

Permalink
remove wsrep_hton dependency from innodb/xtradb
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Jan 8, 2015
1 parent 4ce39dc commit 8655136
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
6 changes: 3 additions & 3 deletions include/mysql/service_wsrep.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extern struct wsrep_service_st {
int (*wsrep_on_func)(MYSQL_THD);
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*);
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_UNLOCK_func)(THD *thd);
void (*wsrep_thd_awake_func)(THD *thd, my_bool signal);
Expand Down Expand Up @@ -119,7 +119,7 @@ extern struct wsrep_service_st {
#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_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_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T)
#define wsrep_thd_awake(T,S) wsrep_service->wsrep_thd_awake_func(T,S)
Expand Down Expand Up @@ -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_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, 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_on(MYSQL_THD thd);
int wsrep_thd_retry_counter(THD *thd);
Expand Down
2 changes: 1 addition & 1 deletion include/service_versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define VERSION_thd_timezone 0x0100
#define VERSION_my_sha1 0x0101
#define VERSION_my_md5 0x0100
#define VERSION_wsrep 0x0100
#define VERSION_wsrep 0x0200
#define VERSION_logger 0x0100
#define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100
Expand Down
2 changes: 1 addition & 1 deletion sql/wsrep_dummy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int wsrep_on(THD *thd)
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; }

void wsrep_thd_LOCK(THD *)
Expand Down
10 changes: 3 additions & 7 deletions sql/wsrep_hton.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ extern ulonglong thd_to_trx_id(THD *thd);
extern "C" int thd_binlog_format(const MYSQL_THD thd);
// 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.
*/
Expand Down Expand Up @@ -157,7 +154,7 @@ static int wsrep_prepare(handlerton *hton, THD *thd, bool all)
!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
(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 == WSREP_TRX_SIZE_EXCEEDED)
Expand Down Expand Up @@ -281,20 +278,19 @@ extern Rpl_filter* binlog_filter;
extern my_bool opt_log_slave_updates;

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;
size_t data_len= 0;
IO_CACHE *cache;
int replay_round= 0;
DBUG_ENTER("wsrep_run_wsrep_commit");

if (thd->get_stmt_da()->is_error()) {
WSREP_ERROR("commit issue, error: %d %s",
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->wsrep_exec_mode == REPL_RECV) {
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7641,7 +7641,7 @@ ha_innobase::write_row(
} else if (src_table == prebuilt->table) {
#ifdef WITH_WSREP
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:
break;
Expand All @@ -7668,7 +7668,7 @@ ha_innobase::write_row(
} else {
#ifdef WITH_WSREP
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:
break;
Expand Down
5 changes: 2 additions & 3 deletions storage/xtradb/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ wsrep_ws_handle(THD* thd, const trx_t* trx) {
(wsrep_trx_id_t)trx->id);
}

extern handlerton * wsrep_hton;
extern TC_LOG* tc_log;
extern void wsrep_cleanup_transaction(THD *thd);
static int
Expand Down Expand Up @@ -8102,7 +8101,7 @@ ha_innobase::write_row(
} else if (src_table == prebuilt->table) {
#ifdef WITH_WSREP
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:
break;
Expand All @@ -8129,7 +8128,7 @@ ha_innobase::write_row(
} else {
#ifdef WITH_WSREP
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:
break;
Expand Down

0 comments on commit 8655136

Please sign in to comment.