Skip to content

Bb 10.4 galera4 mw 286 ctas #16

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

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 2 additions & 0 deletions mysql-test/suite/galera/r/galera_concurrent_ctas.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
connection node_2;
connection node_1;
disconnect node_2;
disconnect node_1;
# End of test
6 changes: 6 additions & 0 deletions sql/service_wsrep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ extern "C" my_bool wsrep_thd_bf_abort(const void* bf_thd_ptr,
{
const THD* bf_thd= (const THD*)bf_thd_ptr;
THD* victim_thd= (THD*)victim_thd_ptr;

if (WSREP(victim_thd) && !victim_thd->wsrep_trx().active())
{
WSREP_DEBUG("BF abort for non active transaction");
wsrep_start_transaction(victim_thd, victim_thd->wsrep_next_trx_id());
}
my_bool ret= wsrep_bf_abort(bf_thd, victim_thd);
/*
Send awake signal if victim was BF aborted or does not
Expand Down
10 changes: 8 additions & 2 deletions sql/sql_insert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4543,8 +4543,14 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
errcode);
}
#ifdef WITH_WSREP
// ha_wsrep_fake_trx_id(thd);
wsrep_start_transaction(thd, thd->wsrep_next_trx_id());
if (thd->wsrep_trx().active())
{
WSREP_DEBUG("transaction already started for CTAS");
}
else
{
wsrep_start_transaction(thd, thd->wsrep_next_trx_id());
}
#endif
return result;
}
Expand Down
8 changes: 8 additions & 0 deletions sql/wsrep_thd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "mariadb.h"
#include "wsrep_thd.h"
#include "wsrep_trans_observer.h"
#include "wsrep_high_priority_service.h"
#include "wsrep_storage_service.h"
#include "transaction.h"
Expand Down Expand Up @@ -420,6 +421,13 @@ bool wsrep_bf_abort(const THD* bf_thd, THD* victim_thd)
WSREP_LOG_THD((THD*)bf_thd, "BF aborter before");
WSREP_LOG_THD(victim_thd, "victim before");
wsrep::seqno bf_seqno(bf_thd->wsrep_trx().ws_meta().seqno());

if (WSREP(victim_thd) && !victim_thd->wsrep_trx().active())
{
WSREP_DEBUG("wsrep_bf_abort, BF abort for non active transaction");
wsrep_start_transaction(victim_thd, victim_thd->wsrep_next_trx_id());
}

bool ret;
if (wsrep_thd_is_toi(bf_thd))
{
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/include/trx0trx.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ struct trx_lock_t {
serving the running transaction. */
#ifdef WITH_WSREP
bool was_chosen_as_wsrep_victim;
/*!< high priority wsrep thread has
marked this trx to abort */
/*!< high priority wsrep thread has marked
this trx to abort */
#endif /* WITH_WSREP */

/** Pre-allocated record locks */
Expand Down