diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2018-12-28 18:51:13 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2018-12-29 14:09:15 +0400 |
commit | d2bdd789150691533698d3949041d867aa9b3bd6 (patch) | |
tree | 90b58c5ad431a10a38875749c9c2eccf84ffb601 /sql | |
parent | 656a702ca9318c58fde97e19ba7b242d11c05c56 (diff) | |
download | mariadb-git-d2bdd789150691533698d3949041d867aa9b3bd6.tar.gz |
Master_info counters transition to Atomic_counter
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 10 | ||||
-rw-r--r-- | sql/mysqld.h | 1 | ||||
-rw-r--r-- | sql/rpl_mi.h | 6 | ||||
-rw-r--r-- | sql/slave.cc | 13 | ||||
-rw-r--r-- | sql/sql_class.cc | 1 | ||||
-rw-r--r-- | sql/sql_statistics.cc | 1 | ||||
-rw-r--r-- | sql/table.cc | 1 |
7 files changed, 10 insertions, 23 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 3ea6be95dda..7a0d0beb5ad 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -53,7 +53,6 @@ #include "rpl_constants.h" #include "sql_digest.h" #include "zlib.h" -#include "my_atomic.h" #define my_b_write_string(A, B) my_b_write((A), (uchar*)(B), (uint) (sizeof(B) - 1)) @@ -8055,16 +8054,13 @@ Gtid_log_event::do_apply_event(rpl_group_info *rgi) switch (flags2 & (FL_DDL | FL_TRANSACTIONAL)) { case FL_TRANSACTIONAL: - my_atomic_add64_explicit((volatile int64 *)&mi->total_trans_groups, 1, - MY_MEMORY_ORDER_RELAXED); + mi->total_trans_groups++; break; case FL_DDL: - my_atomic_add64_explicit((volatile int64 *)&mi->total_ddl_groups, 1, - MY_MEMORY_ORDER_RELAXED); + mi->total_ddl_groups++; break; default: - my_atomic_add64_explicit((volatile int64 *)&mi->total_non_trans_groups, 1, - MY_MEMORY_ORDER_RELAXED); + mi->total_non_trans_groups++; } if (flags2 & FL_STANDALONE) diff --git a/sql/mysqld.h b/sql/mysqld.h index c84e1d08efe..22c572b19fa 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -23,6 +23,7 @@ #include "my_decimal.h" /* my_decimal */ #include "mysql_com.h" /* SERVER_VERSION_LENGTH */ #include "my_atomic.h" +#include "my_counter.h" #include "mysql/psi/mysql_file.h" /* MYSQL_FILE */ #include "mysql/psi/mysql_socket.h" /* MYSQL_SOCKET */ #include "sql_list.h" /* I_List */ diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index 54d6b5be592..5de73254ed9 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -329,13 +329,13 @@ class Master_info : public Slave_reporting_capability /* No of DDL event group */ - volatile uint64 total_ddl_groups; + Atomic_counter<uint64> total_ddl_groups; /* No of non-transactional event group*/ - volatile uint64 total_non_trans_groups; + Atomic_counter<uint64> total_non_trans_groups; /* No of transactional event group*/ - volatile uint64 total_trans_groups; + Atomic_counter<uint64> total_trans_groups; /* domain-id based filter */ Domain_id_filter domain_id_filter; diff --git a/sql/slave.cc b/sql/slave.cc index 03b730b2b00..5fbe0c77661 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3407,16 +3407,9 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full, // Slave_SQL_Running_State protocol->store(slave_sql_running_state, &my_charset_bin); - uint64 events; - events= (uint64)my_atomic_load64_explicit((volatile int64 *) - &mi->total_ddl_groups, MY_MEMORY_ORDER_RELAXED); - protocol->store(events); - events= (uint64)my_atomic_load64_explicit((volatile int64 *) - &mi->total_non_trans_groups, MY_MEMORY_ORDER_RELAXED); - protocol->store(events); - events= (uint64)my_atomic_load64_explicit((volatile int64 *) - &mi->total_trans_groups, MY_MEMORY_ORDER_RELAXED); - protocol->store(events); + protocol->store(mi->total_ddl_groups); + protocol->store(mi->total_non_trans_groups); + protocol->store(mi->total_trans_groups); if (full) { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 2292587bbd0..db805479b65 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -68,7 +68,6 @@ #include "wsrep_mysqld.h" #include "wsrep_thd.h" #include "sql_connect.h" -#include "my_atomic.h" #ifdef HAVE_SYS_SYSCALL_H #include <sys/syscall.h> diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 6f4474860a9..db214a1fe28 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -29,7 +29,6 @@ #include "sql_statistics.h" #include "opt_range.h" #include "uniques.h" -#include "my_atomic.h" #include "sql_show.h" #include "sql_partition.h" diff --git a/sql/table.cc b/sql/table.cc index 6737e57d728..0a40c5fb341 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -44,7 +44,6 @@ #include "sql_cte.h" #include "ha_sequence.h" #include "sql_show.h" -#include <atomic> /* For MySQL 5.7 virtual fields */ #define MYSQL57_GENERATED_FIELD 128 |