Skip to content

Commit 51c5b75

Browse files
committed
Always call mysql_cond_broadcast(&rli->data_cond) under data_lock
This is a safetly fix to try to fix random failures in parallel_backup_xa_debug reported as: sync_slave_with_master failed: 'select master_pos_wait('master-bin.000001', 1034, 300, '')' returned -1 One possible reason could be lost signals, which this patch fixes.
1 parent 5b1bdf6 commit 51c5b75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sql/rpl_parallel.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ handle_queued_pos_update(THD *thd, rpl_parallel_thread::queued_event *qev)
124124
else if (cmp == 0
125125
&& rli->group_master_log_pos < qev->future_event_master_log_pos)
126126
rli->group_master_log_pos= qev->future_event_master_log_pos;
127-
mysql_mutex_unlock(&rli->data_lock);
128127
mysql_cond_broadcast(&rli->data_cond);
128+
mysql_mutex_unlock(&rli->data_lock);
129129
}
130130

131131

sql/slave.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5897,9 +5897,9 @@ pthread_handler_t handle_slave_sql(void *arg)
58975897
rli->relay_log.description_event_for_exec= 0;
58985898
rli->reset_inuse_relaylog();
58995899
/* Wake up master_pos_wait() */
5900-
mysql_mutex_unlock(&rli->data_lock);
59015900
DBUG_PRINT("info",("Signaling possibly waiting master_pos_wait() functions"));
59025901
mysql_cond_broadcast(&rli->data_cond);
5902+
mysql_mutex_unlock(&rli->data_lock);
59035903
rli->ignore_log_space_limit= 0; /* don't need any lock */
59045904
/* we die so won't remember charset - re-update them on next thread start */
59055905
thd->system_thread_info.rpl_sql_info->cached_charset_invalidate();

0 commit comments

Comments
 (0)