Skip to content

Commit 1c0acbd

Browse files
committed
Address Teemu's review comments.
1 parent 8eff4bb commit 1c0acbd

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

sql/wsrep_trans_observer.h

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ static inline bool wsrep_run_commit_hook(THD* thd, bool all)
258258
static inline int wsrep_before_prepare(THD* thd, bool all)
259259
{
260260
DBUG_ENTER("wsrep_before_prepare");
261-
WSREP_DEBUG("wsrep_before_prepare: %d", wsrep_is_real(thd, all));
262261
int ret= 0;
263262
DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
264263
if ((ret= thd->wsrep_parallel_slave_wait_for_prior_commit()))
@@ -279,11 +278,12 @@ static inline int wsrep_before_prepare(THD* thd, bool all)
279278
thd->wsrep_trx().ws_meta().gtid(),
280279
wsrep_gtid_server.undefined());
281280
}
282-
else
283-
{
284-
WSREP_DEBUG("before_prepare failed for %s ret=%s (%d)",
285-
wsrep_xid_print(&thd->wsrep_xid), strerror(ret), ret);
286-
}
281+
282+
WSREP_DEBUG("wsrep_before_prepare: %d for %s ret=%s",
283+
wsrep_is_real(thd, all),
284+
wsrep_xid_print(&thd->wsrep_xid).c_str(),
285+
wsrep::to_c_string(thd->wsrep_cs().current_error()));
286+
287287
mysql_mutex_lock(&thd->LOCK_thd_kill);
288288
if (thd->killed) wsrep_backup_kill_for_commit(thd);
289289
mysql_mutex_unlock(&thd->LOCK_thd_kill);
@@ -318,9 +318,6 @@ static inline int wsrep_after_prepare(THD* thd, bool all)
318318
static inline int wsrep_before_commit(THD* thd, bool all)
319319
{
320320
DBUG_ENTER("wsrep_before_commit");
321-
WSREP_DEBUG("wsrep_before_commit: %d, %lld",
322-
wsrep_is_real(thd, all),
323-
(long long)wsrep_thd_trx_seqno(thd));
324321
int ret= 0;
325322
DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
326323
if ((ret= thd->wsrep_cs().before_commit()) == 0)
@@ -356,6 +353,12 @@ static inline int wsrep_before_commit(THD* thd, bool all)
356353
wsrep_register_for_group_commit(thd);
357354
}
358355

356+
WSREP_DEBUG("wsrep_before_commit: %d seqno=%lld for %s ret=%s",
357+
wsrep_is_real(thd, all),
358+
wsrep_thd_trx_seqno(thd),
359+
wsrep_xid_print(&thd->wsrep_xid).c_str(),
360+
wsrep::to_c_string(thd->wsrep_cs().current_error()));
361+
359362
mysql_mutex_lock(&thd->LOCK_thd_kill);
360363
if (thd->killed) wsrep_backup_kill_for_commit(thd);
361364
mysql_mutex_unlock(&thd->LOCK_thd_kill);
@@ -486,15 +489,13 @@ int wsrep_after_statement(THD* thd)
486489
!thd->internal_transaction() ?
487490
thd->wsrep_cs().after_statement() : 0);
488491

489-
if (ret)
490-
WSREP_DEBUG("wsrep_after_statement for %lu client_state %s "
491-
" client_mode %s trans_state %s ret=%s (%d)",
492-
thd_get_thread_id(thd),
493-
wsrep::to_c_string(thd->wsrep_cs().state()),
494-
wsrep::to_c_string(thd->wsrep_cs().mode()),
495-
wsrep::to_c_string(thd->wsrep_cs().transaction().state()),
496-
strerror(ret), ret);
497-
492+
WSREP_DEBUG("wsrep_after_statement for %lu client_state %s "
493+
" client_mode %s trans_state %s ret=%s",
494+
thd_get_thread_id(thd),
495+
wsrep::to_c_string(thd->wsrep_cs().state()),
496+
wsrep::to_c_string(thd->wsrep_cs().mode()),
497+
wsrep::to_c_string(thd->wsrep_cs().transaction().state()),
498+
wsrep::to_c_string(thd->wsrep_cs().current_error()));
498499

499500
if (wsrep_is_active(thd))
500501
{

0 commit comments

Comments
 (0)