@@ -2687,7 +2687,10 @@ static bool wait_for_relay_log_space(Relay_log_info* rli)
26872687 &rli->log_space_lock ,
26882688 &stage_waiting_for_relay_log_space,
26892689 &old_stage);
2690- while (rli->log_space_limit < rli->log_space_total &&
2690+ while (rli->log_space_limit <
2691+ (ulonglong)my_atomic_load64_explicit ((volatile int64*)
2692+ (&rli->log_space_total ),
2693+ MY_MEMORY_ORDER_RELAXED) &&
26912694 !(slave_killed=io_slave_killed (mi)) &&
26922695 !rli->ignore_log_space_limit )
26932696 mysql_cond_wait (&rli->log_space_cond , &rli->log_space_lock );
@@ -3250,7 +3253,10 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
32503253 protocol->store (mi->rli .last_error ().message , &my_charset_bin);
32513254 protocol->store ((uint32) mi->rli .slave_skip_counter );
32523255 protocol->store ((ulonglong) mi->rli .group_master_log_pos );
3253- protocol->store ((ulonglong) mi->rli .log_space_total );
3256+ protocol->store ((ulonglong)
3257+ my_atomic_load64_explicit ((volatile int64*)
3258+ (&mi->rli .log_space_total ),
3259+ MY_MEMORY_ORDER_RELAXED));
32543260
32553261 protocol->store (
32563262 mi->rli .until_condition ==Relay_log_info::UNTIL_NONE ? " None" :
@@ -4983,7 +4989,9 @@ Stopping slave I/O thread due to out-of-memory error from master");
49834989#endif
49844990
49854991 if (rli->log_space_limit && rli->log_space_limit <
4986- rli->log_space_total &&
4992+ (ulonglong) my_atomic_load64_explicit ((volatile int64*)
4993+ (&rli->log_space_total ),
4994+ MY_MEMORY_ORDER_RELAXED) &&
49874995 !rli->ignore_log_space_limit )
49884996 if (wait_for_relay_log_space (rli))
49894997 {
@@ -7678,7 +7686,10 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size)
76787686 is are able to rotate and purge sometime soon.
76797687 */
76807688 if (rli->log_space_limit &&
7681- rli->log_space_limit < rli->log_space_total )
7689+ rli->log_space_limit <
7690+ (ulonglong) my_atomic_load64_explicit ((volatile int64*)
7691+ (&rli->log_space_total ),
7692+ MY_MEMORY_ORDER_RELAXED))
76827693 {
76837694 /* force rotation if not in an unfinished group */
76847695 rli->sql_force_rotate_relay = !rli->is_in_group ();
0 commit comments