diff options
author | Sachin Setiya <sachinsetia1001@gmail.com> | 2018-04-19 14:31:20 +0530 |
---|---|---|
committer | Sachin Setiya <sachinsetia1001@gmail.com> | 2018-04-19 16:04:23 +0530 |
commit | 419385dbf10453b17a370fd9e5bd934d09e0b440 (patch) | |
tree | d2a82919e9c8f680697d16b37157cd434cb0eb25 /sql/slave.cc | |
parent | 547b00d910b8d5e1526c00aeac9425b182cbea5e (diff) | |
download | mariadb-git-419385dbf10453b17a370fd9e5bd934d09e0b440.tar.gz |
Mdev-10664 Add statuses about optimistic parallel replication stalls
In this commit we are adding three more status variable to SHOW SLAVE
STATUS. Slave_DDL_Events and Slave_Non_Transactional_Events.
Slave_DDL_Groups:- This status variable counts the occurrence of DDL
statements
Slave_Non_Transactional_Groups:- This variable count the occurrence
of non-transnational event group.
Slave_Transactional_Groups:- This variable count the occurrence
of transnational event group.
Patch Credit:- Kristian Nielsen
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 05b9c519017..53902619d26 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3121,6 +3121,19 @@ void show_master_info_get_fields(THD *thd, List<Item> *field_list, field_list->push_back(new (mem_root) Item_empty_string(thd, "Slave_SQL_Running_State", 20)); + field_list->push_back(new (mem_root) + Item_return_int(thd, "Slave_DDL_Groups", 20, + MYSQL_TYPE_LONGLONG), + mem_root); + field_list->push_back(new (mem_root) + Item_return_int(thd, "Slave_Non_Transactional_Groups", 20, + MYSQL_TYPE_LONGLONG), + mem_root); + field_list->push_back(new (mem_root) + Item_return_int(thd, "Slave_Transactional_Groups", 20, + MYSQL_TYPE_LONGLONG), + mem_root); + if (full) { field_list->push_back(new (mem_root) @@ -3351,6 +3364,17 @@ 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); + if (full) { protocol->store((uint32) mi->rli.retried_trans); |