diff options
author | Sujatha <sujatha.sivakumar@mariadb.com> | 2020-11-24 17:22:47 +0530 |
---|---|---|
committer | Sujatha <sujatha.sivakumar@mariadb.com> | 2020-11-24 17:22:47 +0530 |
commit | ae51d2b279c4d5b71c7cac7395a916649951a8df (patch) | |
tree | 941b412b5fbffa48760d8a6a790a0a9efdd9e821 /sql | |
parent | 0a501de2edf6c2bd81333fa8af1f1303186b27ed (diff) | |
download | mariadb-git-10.6-MDEV-16437.tar.gz |
MDEV-16437: merge 5.7 P_S replication instrumentation and tables10.6-MDEV-16437
Merge 'replication_applier_status_by_coordinator' table.
This table captures SQL_THREAD status in case of both single threaded and
multi threaded slave configuration. When multi_source replication is enabled
this table will display each source specific SQL_THREAD status.
Replaced following columns:
- CHANNEL_NAME with CONNECTION_NAME
Added new columns for:
- LAST_SEEN_TRANSACTION
- LAST_TRANS_RETRY_COUNT
Diffstat (limited to 'sql')
-rw-r--r-- | sql/rpl_rli.cc | 3 | ||||
-rw-r--r-- | sql/rpl_rli.h | 3 | ||||
-rw-r--r-- | sql/slave.cc | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index b7127d86fcd..fcdb6ec44ab 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -61,7 +61,7 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery, const char* thread_name) gtid_skip_flag(GTID_SKIP_NOT), inited(0), abort_slave(0), stop_for_until(0), slave_running(MYSQL_SLAVE_NOT_RUN), until_condition(UNTIL_NONE), until_log_pos(0), retried_trans(0), executed_entries(0), - sql_delay(0), sql_delay_end(0), + last_trans_retry_count(0), sql_delay(0), sql_delay_end(0), until_relay_log_names_defer(false), m_flags(0) { @@ -87,6 +87,7 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery, const char* thread_name) max_relay_log_size= global_system_variables.max_relay_log_size; bzero((char*) &info_file, sizeof(info_file)); bzero((char*) &cache_buf, sizeof(cache_buf)); + bzero(&last_seen_gtid, sizeof(last_seen_gtid)); mysql_mutex_init(key_relay_log_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_relay_log_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST); diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index e3b59aa615c..ab221f64b54 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -539,7 +539,8 @@ public: int32 get_sql_delay() { return sql_delay; } void set_sql_delay(int32 _sql_delay) { sql_delay= _sql_delay; } time_t get_sql_delay_end() { return sql_delay_end; } - + rpl_gtid last_seen_gtid; + ulong last_trans_retry_count; private: diff --git a/sql/slave.cc b/sql/slave.cc index da21df7d3c9..bb9a5b3422b 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4450,6 +4450,8 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli, DBUG_RETURN(1); } + rli->last_seen_gtid= serial_rgi->current_gtid; + rli->last_trans_retry_count= serial_rgi->trans_retries; if (opt_gtid_ignore_duplicates && rli->mi->using_gtid != Master_info::USE_GTID_NO) { @@ -5460,6 +5462,7 @@ pthread_handler_t handle_slave_sql(void *arg) serial_rgi->gtid_sub_id= 0; serial_rgi->gtid_pending= false; + rli->last_seen_gtid= serial_rgi->current_gtid; if (mi->using_gtid != Master_info::USE_GTID_NO && mi->using_parallel() && rli->restart_gtid_pos.count() > 0) { |