1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Better SHOW PROCESSLIST for replication

- When waiting for events, start time is now counted from start of wait
- Instead of having "Connect" as "Command" for all replication threads we
  now have:
  - Slave_IO for Slave thread reading relay log
  - Slave_SQL for slave executing SQL commands or distribution queries to
    Slave workers
  - Slave_worker for slave threads executin SQL commands in parallel replication
This commit is contained in:
Monty
2016-08-29 13:10:17 +03:00
parent eac7e57529
commit 96e95b5465
6 changed files with 32 additions and 7 deletions

View File

@ -3193,6 +3193,12 @@ public:
}
ulonglong current_utime() { return microsecond_interval_timer(); }
/* Tell SHOW PROCESSLIST to show time from this point */
inline void set_time_for_next_stage()
{
utime_after_query= current_utime();
}
/**
Update server status after execution of a top level statement.
Currently only checks if a query was slow, and assigns
@ -3202,7 +3208,7 @@ public:
*/
void update_server_status()
{
utime_after_query= current_utime();
set_time_for_next_stage();
if (utime_after_query > utime_after_lock + variables.long_query_time)
server_status|= SERVER_QUERY_WAS_SLOW;
}