Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix passing BF seqno number to bf_abort() #460

Open
wants to merge 3 commits into
base: 10.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions sql/service_wsrep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,21 @@ extern "C" void wsrep_handle_SR_rollback(THD *bf_thd,
victim_thd->wsrep_sr().fragments_certified(),
wsrep_thd_transaction_state_str(victim_thd));

/* Note: do not store/reset globals before wsrep_bf_abort() call
to avoid losing BF thd context. */
if (!(bf_thd && bf_thd != victim_thd))
const bool self_abort= (!bf_thd || bf_thd == victim_thd);
if (self_abort)
{
/* Don't hold the lock in sync wait. wsrep_thd_self_abort() grabs
the same lock again before performing BF abort. */
wsrep_thd_UNLOCK(victim_thd);
DEBUG_SYNC(victim_thd, "wsrep_before_SR_rollback");
}
if (bf_thd)
{
wsrep_bf_abort(bf_thd, victim_thd);
}
else
{
wsrep_thd_self_abort(victim_thd);
}

wsrep_thd_UNLOCK(victim_thd);

if (bf_thd)
else
{
/* Note: do not store/reset globals before wsrep_bf_abort() call
to avoid losing BF thd context. */
wsrep_bf_abort(bf_thd, victim_thd);
wsrep_thd_UNLOCK(victim_thd);
wsrep_store_threadvars(bf_thd);
}
}
Expand Down
2 changes: 1 addition & 1 deletion sql/wsrep_thd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static bool wsrep_bf_abort_low(THD *bf_thd, THD *victim_thd)
};);
#endif

wsrep::seqno bf_seqno(bf_thd->wsrep_trx().ws_meta().seqno());
wsrep::seqno bf_seqno(wsrep_thd_trx_seqno(bf_thd));
bool ret;

{
Expand Down