@@ -5437,7 +5437,7 @@ static bool abort_replicated(THD *thd)
5437
5437
bool ret_code= false ;
5438
5438
if (thd->wsrep_query_state == QUERY_COMMITTING)
5439
5439
{
5440
- if (wsrep_debug) WSREP_INFO (" aborting replicated trx: %lu" , thd->real_id );
5440
+ WSREP_DEBUG (" aborting replicated trx: %lu" , thd->real_id );
5441
5441
5442
5442
(void )wsrep_abort_thd (thd, thd, TRUE );
5443
5443
ret_code= true ;
@@ -5507,23 +5507,6 @@ static bool have_client_connections()
5507
5507
return false ;
5508
5508
}
5509
5509
5510
- /*
5511
- returns the number of wsrep appliers running.
5512
- However, the caller (thd parameter) is not taken in account
5513
- */
5514
- static int have_wsrep_appliers (THD *thd)
5515
- {
5516
- int ret= 0 ;
5517
- THD *tmp;
5518
-
5519
- I_List_iterator<THD> it (threads);
5520
- while ((tmp=it++))
5521
- {
5522
- ret+= (tmp != thd && tmp->wsrep_applier );
5523
- }
5524
- return ret;
5525
- }
5526
-
5527
5510
static void wsrep_close_thread (THD *thd)
5528
5511
{
5529
5512
thd->killed = KILL_CONNECTION;
@@ -5639,8 +5622,7 @@ void wsrep_close_client_connections(my_bool wait_to_end)
5639
5622
}
5640
5623
5641
5624
DBUG_PRINT (" quit" ,(" Waiting for threads to die (count=%u)" ,thread_count));
5642
- if (wsrep_debug)
5643
- WSREP_INFO (" waiting for client connections to close: %u" , thread_count);
5625
+ WSREP_DEBUG (" waiting for client connections to close: %u" , thread_count);
5644
5626
5645
5627
while (wait_to_end && have_client_connections ())
5646
5628
{
@@ -5682,33 +5664,11 @@ static void wsrep_close_threads(THD *thd)
5682
5664
mysql_mutex_unlock (&LOCK_thread_count);
5683
5665
}
5684
5666
5685
- void wsrep_close_applier_threads (int count)
5686
- {
5687
- THD *tmp;
5688
- mysql_mutex_lock (&LOCK_thread_count); // For unlink from list
5689
-
5690
- I_List_iterator<THD> it (threads);
5691
- while ((tmp=it++) && count)
5692
- {
5693
- DBUG_PRINT (" quit" ,(" Informing thread %ld that it's time to die" ,
5694
- tmp->thread_id ));
5695
- /* We skip slave threads & scheduler on this first loop through. */
5696
- if (tmp->wsrep_applier )
5697
- {
5698
- WSREP_DEBUG (" closing wsrep applier thread %ld" , tmp->thread_id );
5699
- tmp->wsrep_applier_closing = TRUE ;
5700
- count--;
5701
- }
5702
- }
5703
-
5704
- mysql_mutex_unlock (&LOCK_thread_count);
5705
- }
5706
-
5707
5667
void wsrep_wait_appliers_close (THD *thd)
5708
5668
{
5709
5669
/* Wait for wsrep appliers to gracefully exit */
5710
5670
mysql_mutex_lock (&LOCK_thread_count);
5711
- while (have_wsrep_appliers (thd) > 1 )
5671
+ while (wsrep_running_threads > 1 )
5712
5672
// 1 is for rollbacker thread which needs to be killed explicitly.
5713
5673
// This gotta be fixed in a more elegant manner if we gonna have arbitrary
5714
5674
// number of non-applier wsrep threads.
@@ -5728,7 +5688,7 @@ void wsrep_wait_appliers_close(THD *thd)
5728
5688
wsrep_close_threads (thd);
5729
5689
/* and wait for them to die */
5730
5690
mysql_mutex_lock (&LOCK_thread_count);
5731
- while (have_wsrep_appliers (thd) > 0 )
5691
+ while (wsrep_running_threads > 0 )
5732
5692
{
5733
5693
if (thread_handling > SCHEDULER_ONE_THREAD_PER_CONNECTION)
5734
5694
{
0 commit comments