Commit 5d1db345 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: void hton::abort_transaction()

and void wsrep_innobase_kill_one_trx()

as their return values are never used.
Also remove redundant cast and checks that are always true
parent 6a1cb449
...@@ -1237,7 +1237,7 @@ struct handlerton ...@@ -1237,7 +1237,7 @@ struct handlerton
enum handler_create_iterator_result enum handler_create_iterator_result
(*create_iterator)(handlerton *hton, enum handler_iterator_type type, (*create_iterator)(handlerton *hton, enum handler_iterator_type type,
struct handler_iterator *fill_this_in); struct handler_iterator *fill_this_in);
int (*abort_transaction)(handlerton *hton, THD *bf_thd, void (*abort_transaction)(handlerton *hton, THD *bf_thd,
THD *victim_thd, my_bool signal); THD *victim_thd, my_bool signal);
int (*set_checkpoint)(handlerton *hton, const XID* xid); int (*set_checkpoint)(handlerton *hton, const XID* xid);
int (*get_checkpoint)(handlerton *hton, XID* xid); int (*get_checkpoint)(handlerton *hton, XID* xid);
......
...@@ -167,11 +167,8 @@ wsrep_ws_handle(THD* thd, const trx_t* trx) { ...@@ -167,11 +167,8 @@ wsrep_ws_handle(THD* thd, const trx_t* trx) {
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 void wsrep_abort_transaction(handlerton*, THD *, THD *, my_bool);
wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, static void wsrep_fake_trx_id(handlerton* hton, THD *thd);
my_bool signal);
static void
wsrep_fake_trx_id(handlerton* hton, THD *thd);
static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid); static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid);
static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid); static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid);
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
...@@ -19507,35 +19504,27 @@ wsrep_abort_slave_trx( ...@@ -19507,35 +19504,27 @@ wsrep_abort_slave_trx(
/*******************************************************************//** /*******************************************************************//**
This function is used to kill one transaction in BF. */ This function is used to kill one transaction in BF. */
UNIV_INTERN UNIV_INTERN
int void
wsrep_innobase_kill_one_trx( wsrep_innobase_kill_one_trx(
/*========================*/ /*========================*/
void * const bf_thd_ptr, MYSQL_THD const bf_thd,
const trx_t * const bf_trx, const trx_t * const bf_trx,
trx_t *victim_trx, trx_t *victim_trx,
ibool signal) ibool signal)
{ {
ut_ad(bf_thd);
ut_ad(victim_trx);
ut_ad(lock_mutex_own()); ut_ad(lock_mutex_own());
ut_ad(trx_mutex_own(victim_trx)); ut_ad(trx_mutex_own(victim_trx));
ut_ad(bf_thd_ptr);
ut_ad(victim_trx);
DBUG_ENTER("wsrep_innobase_kill_one_trx"); DBUG_ENTER("wsrep_innobase_kill_one_trx");
THD *bf_thd = bf_thd_ptr ? (THD*) bf_thd_ptr : NULL;
THD *thd = (THD *) victim_trx->mysql_thd; THD *thd = (THD *) victim_trx->mysql_thd;
int64_t bf_seqno = (bf_thd) ? wsrep_thd_trx_seqno(bf_thd) : 0; int64_t bf_seqno = wsrep_thd_trx_seqno(bf_thd);
if (!thd) { if (!thd) {
DBUG_PRINT("wsrep", ("no thd for conflicting lock")); DBUG_PRINT("wsrep", ("no thd for conflicting lock"));
WSREP_WARN("no THD for trx: " TRX_ID_FMT, victim_trx->id); WSREP_WARN("no THD for trx: " TRX_ID_FMT, victim_trx->id);
DBUG_RETURN(1); DBUG_VOID_RETURN;
}
if (!bf_thd) {
DBUG_PRINT("wsrep", ("no BF thd for conflicting lock"));
WSREP_WARN("no BF THD for trx: " TRX_ID_FMT,
bf_trx ? bf_trx->id : 0);
DBUG_RETURN(1);
} }
WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); WSREP_LOG_CONFLICT(bf_thd, thd, TRUE);
...@@ -19566,7 +19555,7 @@ wsrep_innobase_kill_one_trx( ...@@ -19566,7 +19555,7 @@ wsrep_innobase_kill_one_trx(
WSREP_DEBUG("kill trx EXITING for " TRX_ID_FMT, WSREP_DEBUG("kill trx EXITING for " TRX_ID_FMT,
victim_trx->id); victim_trx->id);
wsrep_thd_UNLOCK(thd); wsrep_thd_UNLOCK(thd);
DBUG_RETURN(0); DBUG_VOID_RETURN;
} }
if (wsrep_thd_exec_mode(thd) != LOCAL_STATE) { if (wsrep_thd_exec_mode(thd) != LOCAL_STATE) {
...@@ -19584,7 +19573,7 @@ wsrep_innobase_kill_one_trx( ...@@ -19584,7 +19573,7 @@ wsrep_innobase_kill_one_trx(
victim_trx->id); victim_trx->id);
wsrep_thd_UNLOCK(thd); wsrep_thd_UNLOCK(thd);
wsrep_thd_awake(thd, signal); wsrep_thd_awake(thd, signal);
DBUG_RETURN(0); DBUG_VOID_RETURN;
break; break;
case ABORTED: case ABORTED:
case ABORTING: // fall through case ABORTING: // fall through
...@@ -19592,7 +19581,7 @@ wsrep_innobase_kill_one_trx( ...@@ -19592,7 +19581,7 @@ wsrep_innobase_kill_one_trx(
WSREP_DEBUG("victim " TRX_ID_FMT " in state %d", WSREP_DEBUG("victim " TRX_ID_FMT " in state %d",
victim_trx->id, wsrep_thd_get_conflict_state(thd)); victim_trx->id, wsrep_thd_get_conflict_state(thd));
wsrep_thd_UNLOCK(thd); wsrep_thd_UNLOCK(thd);
DBUG_RETURN(0); DBUG_VOID_RETURN;
break; break;
} }
...@@ -19622,7 +19611,7 @@ wsrep_innobase_kill_one_trx( ...@@ -19622,7 +19611,7 @@ wsrep_innobase_kill_one_trx(
victim_trx->id); victim_trx->id);
wsrep_thd_UNLOCK(thd); wsrep_thd_UNLOCK(thd);
wsrep_thd_awake(thd, signal); wsrep_thd_awake(thd, signal);
DBUG_RETURN(1); DBUG_VOID_RETURN;
break; break;
case WSREP_OK: case WSREP_OK:
break; break;
...@@ -19692,7 +19681,7 @@ wsrep_innobase_kill_one_trx( ...@@ -19692,7 +19681,7 @@ wsrep_innobase_kill_one_trx(
wsrep_thd_UNLOCK(thd); wsrep_thd_UNLOCK(thd);
wsrep_abort_slave_trx(bf_seqno, wsrep_abort_slave_trx(bf_seqno,
wsrep_thd_trx_seqno(thd)); wsrep_thd_trx_seqno(thd));
DBUG_RETURN(0); DBUG_VOID_RETURN;
} }
/* This will lock thd from proceeding after net_read() */ /* This will lock thd from proceeding after net_read() */
wsrep_thd_set_conflict_state(thd, ABORTING); wsrep_thd_set_conflict_state(thd, ABORTING);
...@@ -19724,11 +19713,11 @@ wsrep_innobase_kill_one_trx( ...@@ -19724,11 +19713,11 @@ wsrep_innobase_kill_one_trx(
break; break;
} }
DBUG_RETURN(0); DBUG_VOID_RETURN;
} }
static static
int void
wsrep_abort_transaction( wsrep_abort_transaction(
/*====================*/ /*====================*/
handlerton* hton, handlerton* hton,
...@@ -19736,7 +19725,7 @@ wsrep_abort_transaction( ...@@ -19736,7 +19725,7 @@ wsrep_abort_transaction(
THD *victim_thd, THD *victim_thd,
my_bool signal) my_bool signal)
{ {
DBUG_ENTER("wsrep_innobase_abort_thd"); DBUG_ENTER("wsrep_abort_transaction");
trx_t* victim_trx = thd_to_trx(victim_thd); trx_t* victim_trx = thd_to_trx(victim_thd);
trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL; trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL;
...@@ -19749,12 +19738,11 @@ wsrep_abort_transaction( ...@@ -19749,12 +19738,11 @@ wsrep_abort_transaction(
if (victim_trx) { if (victim_trx) {
lock_mutex_enter(); lock_mutex_enter();
trx_mutex_enter(victim_trx); trx_mutex_enter(victim_trx);
int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, wsrep_innobase_kill_one_trx(bf_thd, bf_trx, victim_trx, signal);
victim_trx, signal);
lock_mutex_exit(); lock_mutex_exit();
trx_mutex_exit(victim_trx); trx_mutex_exit(victim_trx);
wsrep_srv_conc_cancel_wait(victim_trx); wsrep_srv_conc_cancel_wait(victim_trx);
DBUG_RETURN(rcode); DBUG_VOID_RETURN;
} else { } else {
WSREP_DEBUG("victim does not have transaction"); WSREP_DEBUG("victim does not have transaction");
wsrep_thd_LOCK(victim_thd); wsrep_thd_LOCK(victim_thd);
...@@ -19763,7 +19751,7 @@ wsrep_abort_transaction( ...@@ -19763,7 +19751,7 @@ wsrep_abort_transaction(
wsrep_thd_awake(victim_thd, signal); wsrep_thd_awake(victim_thd, signal);
} }
DBUG_RETURN(-1); DBUG_VOID_RETURN;
} }
static static
......
...@@ -234,8 +234,8 @@ innobase_casedn_str( ...@@ -234,8 +234,8 @@ innobase_casedn_str(
#ifdef WITH_WSREP #ifdef WITH_WSREP
UNIV_INTERN UNIV_INTERN
int void
wsrep_innobase_kill_one_trx(void * const thd_ptr, wsrep_innobase_kill_one_trx(MYSQL_THD const thd_ptr,
const trx_t * const bf_trx, const trx_t * const bf_trx,
trx_t *victim_trx, trx_t *victim_trx,
ibool signal); ibool signal);
......
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