From 94f1d0f84d58535e6f14a33b91daf7f47da4a29e Mon Sep 17 00:00:00 2001 From: Sujatha Date: Thu, 8 Apr 2021 15:49:32 +0530 Subject: MDEV-20220: Merge 5.7 P_S replication table 'replication_applier_status_by_worker Step1: ===== Backport 'replication_applier_status_by_worker' from upstream. Iterate through rpl_parallel_thread_pool and display slave worker thread specific information as part of 'replication_applier_status_by_worker' table. --------------------------------------------------------------------------- |Column Name: | Description: | |-------------------------------------------------------------------------| | | | |CHANNEL_NAME | Name of replication channel through which the | | | transaction is received. | | | | |THREAD_ID | Thread_Id as displayed in 'performance_schema. | | | threads' table for thread with name | | | 'thread/sql/rpl_parallel_thread' | | | | | | THREAD_ID will be NULL when worker threads are | | | stopped due to an error/force stop | | | | |SERVICE_STATE | Thread is running or not | | | | |LAST_SEEN_TRANSACTION | Last GTID executed by worker | | | | |LAST_ERROR_NUMBER | Last Error that occured on a particular worker | | | | |LAST_ERROR_MESSAGE | Last error specific message | | | | |LAST_ERROR_TIMESTAMP | Time stamp of last error | | | | --------------------------------------------------------------------------- CHANNEL_NAME will be empty when the worker has not processed any transaction. Channel_name points to valid source channel_name when it is processing a transaction/event group. --- sql/rpl_parallel.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sql/rpl_parallel.h') diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index b88e77d5427..49e245176ff 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -161,6 +161,12 @@ struct rpl_parallel_thread { inuse_relaylog *accumulated_ir_last; uint64 accumulated_ir_count; + char channel_name[MAX_CONNECTION_NAME]; + uint channel_name_length; + rpl_gtid last_seen_gtid; + int last_error_number; + char last_error_message[MAX_SLAVE_ERRMSG]; + ulonglong last_error_timestamp; void enqueue(queued_event *qev) { if (last_in_queue) @@ -224,6 +230,7 @@ struct rpl_parallel_thread { void batch_free(); /* Update inuse_relaylog refcounts with what we have accumulated so far. */ void inuse_relaylog_refcount_update(); + rpl_parallel_thread(); }; -- cgit v1.2.1