1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Relay_log_info::executed_entries to Atomic_counter

This commit is contained in:
Sergey Vojtovich
2020-04-15 18:35:48 +04:00
parent c1bdf62452
commit 5876ed9e5b
4 changed files with 4 additions and 14 deletions

View File

@@ -827,16 +827,6 @@ static inline void thread_safe_decrement32(int32 *value)
(void) my_atomic_add32_explicit(value, -1, MY_MEMORY_ORDER_RELAXED); (void) my_atomic_add32_explicit(value, -1, MY_MEMORY_ORDER_RELAXED);
} }
static inline void thread_safe_increment64(int64 *value)
{
(void) my_atomic_add64_explicit(value, 1, MY_MEMORY_ORDER_RELAXED);
}
static inline void thread_safe_decrement64(int64 *value)
{
(void) my_atomic_add64_explicit(value, -1, MY_MEMORY_ORDER_RELAXED);
}
/* /*
No locking needed, the counter is owned by the thread No locking needed, the counter is owned by the thread
*/ */

View File

@@ -60,7 +60,7 @@ rpt_handle_event(rpl_parallel_thread::queued_event *qev,
rgi->last_master_timestamp= ev->when + (time_t)ev->exec_time; rgi->last_master_timestamp= ev->when + (time_t)ev->exec_time;
err= apply_event_and_update_pos_for_parallel(ev, thd, rgi); err= apply_event_and_update_pos_for_parallel(ev, thd, rgi);
thread_safe_increment64(&rli->executed_entries); rli->executed_entries++;
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_after_statement(thd)) if (wsrep_after_statement(thd))
{ {

View File

@@ -347,7 +347,7 @@ public:
Number of executed events for SLAVE STATUS. Number of executed events for SLAVE STATUS.
Protected by slave_executed_entries_lock Protected by slave_executed_entries_lock
*/ */
int64 executed_entries; Atomic_counter<uint32_t> executed_entries;
/* /*
If the end of the hot relay log is made of master's events ignored by the If the end of the hot relay log is made of master's events ignored by the

View File

@@ -3438,7 +3438,7 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
{ {
protocol->store((uint32) mi->rli.retried_trans); protocol->store((uint32) mi->rli.retried_trans);
protocol->store((ulonglong) mi->rli.max_relay_log_size); protocol->store((ulonglong) mi->rli.max_relay_log_size);
protocol->store((uint32) mi->rli.executed_entries); protocol->store(mi->rli.executed_entries);
protocol->store((uint32) mi->received_heartbeats); protocol->store((uint32) mi->received_heartbeats);
protocol->store((double) mi->heartbeat_period, 3, &tmp); protocol->store((double) mi->heartbeat_period, 3, &tmp);
protocol->store(gtid_pos->ptr(), gtid_pos->length(), &my_charset_bin); protocol->store(gtid_pos->ptr(), gtid_pos->length(), &my_charset_bin);
@@ -4537,7 +4537,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
} }
} }
thread_safe_increment64(&rli->executed_entries); rli->executed_entries++;
#ifdef WITH_WSREP #ifdef WITH_WSREP
wsrep_after_statement(thd); wsrep_after_statement(thd);
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */