diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/slave.cc | 9 | ||||
-rw-r--r-- | sql/slave.h | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index ce6c7702e3c..a5761f7b74e 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -492,7 +492,8 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, pthread_cond_t *start_cond, volatile bool *slave_running, volatile ulong *slave_run_id, - MASTER_INFO* mi) + MASTER_INFO* mi, + bool high_priority) { pthread_t th; ulong start_id; @@ -521,6 +522,8 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, } start_id= *slave_run_id; DBUG_PRINT("info",("Creating new slave thread")); + if (high_priority) + my_pthread_attr_setprio(&connection_attrib,CONNECT_PRIOR); if (pthread_create(&th, &connection_attrib, h_func, (void*)mi)) { if (start_lock) @@ -585,13 +588,13 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, error=start_slave_thread(handle_slave_io,lock_io,lock_cond_io, cond_io, &mi->slave_running, &mi->slave_run_id, - mi); + mi, 1); //high priority, to read the most possible if (!error && (thread_mask & SLAVE_SQL)) { error=start_slave_thread(handle_slave_sql,lock_sql,lock_cond_sql, cond_sql, &mi->rli.slave_running, &mi->rli.slave_run_id, - mi); + mi, 0); if (error) terminate_slave_threads(mi, thread_mask & SLAVE_IO, 0); } diff --git a/sql/slave.h b/sql/slave.h index 5dd7fe8072b..4923eec3ae7 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -368,7 +368,8 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock, pthread_cond_t* start_cond, volatile bool *slave_running, volatile ulong *slave_run_id, - MASTER_INFO* mi); + MASTER_INFO* mi, + bool high_priority); /* If fd is -1, dump to NET */ int mysql_table_dump(THD* thd, const char* db, |