mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
bzr merge -r3928..3932 codership/5.5
This commit is contained in:
@ -2721,7 +2721,9 @@ mysql_execute_command(THD *thd)
|
||||
if (trans_commit_implicit(thd))
|
||||
{
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_DEBUG("implicit commit failed, MDL released: %lu", thd->thread_id);
|
||||
#endif /* WITH_WSREP */
|
||||
goto error;
|
||||
}
|
||||
/* Release metadata locks acquired in this transaction. */
|
||||
@ -4711,7 +4713,9 @@ end_with_restore_list:
|
||||
if (trans_begin(thd, lex->start_transaction_opt))
|
||||
{
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_DEBUG("BEGIN failed, MDL released: %lu", thd->thread_id);
|
||||
#endif /* WITH_WSREP */
|
||||
goto error;
|
||||
}
|
||||
my_ok(thd);
|
||||
@ -4729,7 +4733,9 @@ end_with_restore_list:
|
||||
if (trans_commit(thd))
|
||||
{
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_DEBUG("COMMIT failed, MDL released: %lu", thd->thread_id);
|
||||
#endif /* WITH_WSREP */
|
||||
goto error;
|
||||
}
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
@ -4780,7 +4786,9 @@ end_with_restore_list:
|
||||
if (trans_rollback(thd))
|
||||
{
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_DEBUG("rollback failed, MDL released: %lu", thd->thread_id);
|
||||
#endif /* WITH_WSREP */
|
||||
goto error;
|
||||
}
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
@ -5327,7 +5335,9 @@ create_sp_error:
|
||||
if (trans_xa_commit(thd))
|
||||
{
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_DEBUG("XA commit failed, MDL released: %lu", thd->thread_id);
|
||||
#endif /* WITH_WSREP */
|
||||
goto error;
|
||||
}
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
@ -5343,7 +5353,9 @@ create_sp_error:
|
||||
if (trans_xa_rollback(thd))
|
||||
{
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_DEBUG("XA rollback failed, MDL released: %lu", thd->thread_id);
|
||||
#endif /* WITH_WSREP */
|
||||
goto error;
|
||||
}
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
|
@ -3190,7 +3190,9 @@ static bool fix_autocommit(sys_var *self, THD *thd, enum_var_type type)
|
||||
{
|
||||
thd->variables.option_bits&= ~OPTION_AUTOCOMMIT;
|
||||
thd->mdl_context.release_transactional_locks();
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_DEBUG("autocommit, MDL TRX lock released: %lu", thd->thread_id);
|
||||
#endif /* WITH_WSREP */
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
|
@ -407,14 +407,26 @@ void wsrep_ready_wait ()
|
||||
static void wsrep_synced_cb(void* app_ctx)
|
||||
{
|
||||
WSREP_INFO("Synchronized with group, ready for connections");
|
||||
bool signal_main= false;
|
||||
if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort();
|
||||
if (!wsrep_ready)
|
||||
{
|
||||
wsrep_ready= TRUE;
|
||||
mysql_cond_signal (&COND_wsrep_ready);
|
||||
signal_main= true;
|
||||
|
||||
}
|
||||
local_status.set(WSREP_MEMBER_SYNCED);
|
||||
mysql_mutex_unlock (&LOCK_wsrep_ready);
|
||||
|
||||
if (signal_main)
|
||||
{
|
||||
wsrep_SE_init_grab();
|
||||
// Signal mysqld init thread to continue
|
||||
wsrep_sst_complete (&local_uuid, local_seqno, false);
|
||||
// and wait for SE initialization
|
||||
wsrep_SE_init_wait();
|
||||
}
|
||||
}
|
||||
|
||||
static void wsrep_init_position()
|
||||
|
@ -231,7 +231,13 @@ void wsrep_sst_complete (const wsrep_uuid_t* sst_uuid,
|
||||
}
|
||||
else
|
||||
{
|
||||
WSREP_WARN("Nobody is waiting for SST.");
|
||||
/* This can happen when called from wsrep_synced_cb().
|
||||
At the moment there is no way to check there
|
||||
if main thread is still waiting for signal,
|
||||
so wsrep_sst_complete() is called from there
|
||||
each time wsrep_ready changes from FALSE -> TRUE.
|
||||
*/
|
||||
WSREP_DEBUG("Nobody is waiting for SST.");
|
||||
}
|
||||
mysql_mutex_unlock (&LOCK_wsrep_sst);
|
||||
}
|
||||
@ -1048,8 +1054,11 @@ void wsrep_SE_init_grab()
|
||||
}
|
||||
|
||||
void wsrep_SE_init_wait()
|
||||
{
|
||||
while (SE_initialized == false)
|
||||
{
|
||||
mysql_cond_wait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init);
|
||||
}
|
||||
mysql_mutex_unlock (&LOCK_wsrep_sst_init);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user