MySQL Forums
Forum List  »  Replication

Last binlog applied timestamp
Posted by: Vijayaraghavan Baskaradoss
Date: April 18, 2022 01:34AM

Hi Team


We are looking for query from MYSQL System tables to check last applied Binlog with timestamp / last sync records applied timestamp in slave server .

DB Version is 5.7.x and 8.0.x


I found below query on internet



SELECT distinct
channel_name AS Channel_Name,
smi.host AS Master_Host,
smi.user_name AS Master_User,
smi.port AS Master_Port,
smi.master_log_name AS Master_Log_File,
smi.master_log_pos AS Read_Master_Log_Pos,
ssi.master_log_pos AS Exec_Master_Log_Pos,
rcs.service_state AS Slave_IO_Running,
rss.service_state AS Slave_SQL_Running,
t.processlist_time AS Seconds_Behind_Master,
rcs.last_error_number AS Last_IO_Errno,
rcs.last_error_message AS Last_IO_Error,
rss.last_error_number AS Last_SQL_Errno,
rss.last_error_message AS Last_SQL_Error,
tc.processlist_state AS Slave_IO_State,
t.processlist_state AS Slave_SQL_Running_State
FROM
mysql.slave_master_info smi
JOIN
mysql.slave_relay_log_info ssi USING (channel_name)
JOIN
performance_schema.replication_connection_status rcs USING (channel_name)
LEFT JOIN
performance_schema.replication_applier_status_by_worker rss USING (channel_name)
LEFT JOIN
performance_schema.threads t ON (rss.thread_id = t.thread_id)
LEFT JOIN
performance_schema.threads tc ON (rcs.thread_id = tc.thread_id)
t.processlist_time AS Seconds_Behind_Master,


second behind master giving inaccurate information is there any other similar query to check second behind master/last sync records applied time from system tables in slave using query

Options: ReplyQuote


Subject
Views
Written By
Posted
Last binlog applied timestamp
111
April 18, 2022 01:34AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.