1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Final push for WL#1098:

"Add a column "Timestamp_of_last_master_event_executed" in SHOW SLAVE STATUS".
Finally this is adding
- Slave_IO_State (a copy of the State column of SHOW PROCESSLIST for the I/O thread,
so that the users, most of the time, has enough info with only SHOW SLAVE STATUS).
- Seconds_behind_master. When the slave connects to the master it does SELECT UNIX_TIMESTAMP()
on the master, computes the absolute difference between the master's and the slave's clock.
It records the timestamp of the last event executed by the SQL thread, and does a
small computation to find the number of seconds by which the slave is late.
This commit is contained in:
guilhem@gbichot2
2003-10-09 00:06:21 +02:00
parent 324ff6dedf
commit c0075fa64b
33 changed files with 190 additions and 87 deletions

View File

@@ -878,7 +878,11 @@ int reset_slave(THD *thd, MASTER_INFO* mi)
STATUS; before doing START SLAVE;
*/
init_master_info_with_options(mi);
clear_last_slave_error(&mi->rli);
/*
Reset errors, and master timestamp (the idea is that we forget about the
old master).
*/
clear_slave_error_timestamp(&mi->rli);
clear_until_condition(&mi->rli);
// close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0
@@ -1092,8 +1096,8 @@ int change_master(THD* thd, MASTER_INFO* mi)
pthread_mutex_lock(&mi->rli.data_lock);
mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */
/* Clear the error, for a clean start. */
clear_last_slave_error(&mi->rli);
/* Clear the errors, for a clean start, and master timestamp */
clear_slave_error_timestamp(&mi->rli);
clear_until_condition(&mi->rli);
/*
If we don't write new coordinates to disk now, then old will remain in