processlist_repl

NAME

processlist_repl: Listing of replication processes: the server's slave threads and any replicating slaves

TYPE

View

DESCRIPTION

processlist_repl displays only replication processes. These may include:

  • Connected slaves: when this server acts as a master, each slave connects using a single process. A slave with running IO thread will appear in this server's processlist_repl
  • IO thread: if this server is itself a replicating slave
  • SQL thread: if this server is itself a replicating slave

This view provides with a quick look at replication status processlist-wise.

STRUCTURE

mysql> DESC common_schema.processlist_repl;
+---------------+-------------+------+-----+---------+-------+
| Field         | Type        | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| ID            | bigint(4)   | NO   |     | 0       |       |
| USER          | varchar(16) | NO   |     |         |       |
| HOST          | varchar(64) | NO   |     |         |       |
| DB            | varchar(64) | YES  |     | NULL    |       |
| COMMAND       | varchar(16) | NO   |     |         |       |
| TIME          | int(7)      | NO   |     | 0       |       |
| STATE         | varchar(64) | YES  |     | NULL    |       |
| INFO          | longtext    | YES  |     | NULL    |       |
| is_system     | int(1)      | NO   |     | 0       |       |
| is_io_thread  | int(1)      | NO   |     | 0       |       |
| is_sql_thread | int(1)      | NO   |     | 0       |       |
| is_slave      | int(1)      | NO   |     | 0       |       |
+---------------+-------------+------+-----+---------+-------+

SYNOPSIS

Structure of this view derives from INFORMATION_SCHEMA.PROCESSLIST table

Additional columns are:

  • is_system: 1 if this is the system user (SQL or IO slave threads); 0 otherwise.
  • is_io_thread: 1 if this is the slave IO thread, 0 otherwise.
  • is_sql_thread: 1 if this is the slave SQL thread, 0 otherwise.
  • is_slave: 1 if this is a replicating slave connection; 0 otherwise.
is_system and is_slave are mutually exclusive. In this view every process is either is_system or is_slave.
An is_system process is either a slave IO thread or SQL thread, as denoted by is_io_thread and is_sql_thread, respectively.

On Percona Server, this additional info is included:

  • TIME_MS: execution time in milliseconds

EXAMPLES

Show all replication processes

mysql> SELECT * FROM common_schema.processlist_repl;
+--------+-------------+-------------+------+-------------+-------+------------------------------------------------------------------+------+----------+-----------+--------------+---------------+----------+
| ID     | USER        | HOST        | DB   | COMMAND     | TIME  | STATE                                                            | INFO | TIME_MS  | is_system | is_io_thread | is_sql_thread | is_slave |
+--------+-------------+-------------+------+-------------+-------+------------------------------------------------------------------+------+----------+-----------+--------------+---------------+----------+
| 805225 | system user |             | NULL | Connect     |     0 | Has read all relay log; waiting for the slave I/O thread to upda | NULL |        0 |         1 |            0 |             1 |        0 |
| 805224 | system user |             | NULL | Connect     |     5 | Waiting for master to send event                                 | NULL |     4327 |         1 |            1 |             0 |        0 |
| 425707 | repl_user   | sql02:46645 | NULL | Binlog Dump | 38273 | Has sent all binlog to slave; waiting for binlog to be updated   | NULL | 38272802 |         0 |            0 |             0 |        1 |
|     88 | repl_user   | sql00:46485 | NULL | Binlog Dump | 79071 | Has sent all binlog to slave; waiting for binlog to be updated   | NULL | 79070732 |         0 |            0 |             0 |        1 |
+--------+-------------+-------------+------+-------------+-------+------------------------------------------------------------------+------+----------+-----------+--------------+---------------+----------+

In the above example we see two slaves replicating from this server (sql02 & sql00), and the two threads (IO thread, SQL thread) this server uses to replication from its master

ENVIRONMENT

MySQL 5.1 or newer. Percona Server yields a different schema.

SEE ALSO

processlist_per_userhost, processlist_summary, processlist_top, slave_status

AUTHOR

Shlomi Noach
 
common_schema documentation