View a markdown version of this page

Process list table: router_processlist - Amazon Aurora

Process list table: router_processlist

The process list of a database cluster group for Aurora has one row for each session at the routing endpoint. It's the table dbclustergroup_sys.router_processlist.

Purpose

Use the process list to see who is connected through the routing endpoint, what each session runs, and which member cluster each session reaches. It shows the sessions of every routing-layer instance in the group that answers. An instance that doesn't answer adds no rows, and the result carries a warning that some rows are missing. Run SHOW WARNINGS after the query to check. The process list is read-only.

The process list shows routing endpoint sessions only. Direct connections to a member cluster's endpoint, such as maintenance scripts, batch jobs, and schema tools, appear only on that member cluster. To see the member cluster side of a session, read the session list on the member cluster. To follow one session to its member cluster sessions, see Tracing a session or statement across the group.

Any router user sees their own sessions, with the user, host, and statement text of each. To see the sessions of other router users, you need dbclustergroup_process_admin.

Columns and example queries

The table is dbclustergroup_sys.router_processlist. At the routing endpoint, SHOW PROCESSLIST and SHOW FULL PROCESSLIST don't read this table and return error 1235, so query this table instead. In a session pinned with router_cluster_pin, SHOW PROCESSLIST returns the process list of the pinned member cluster, not the routing layer's sessions.

Columns

The table has the following columns.

Column Type Description
id BIGINT The global connection ID of the session: a 32-bit positive integer that is unique across the group. It stays with the session for its whole life, and it's the ID that KILL takes.
user VARCHAR The router user.
host VARCHAR The client host, without a port.
db VARCHAR The default database of the session, as in SHOW PROCESSLIST.
command VARCHAR Query or Sleep.
time BIGINT The time in seconds that the session has been in its current state, as in SHOW PROCESSLIST. The timer restarts when the statement moves from ROUTING to EXECUTING.
state VARCHAR IDLE, ROUTING while the routing layer parses and routes the statement, or EXECUTING after it sends the statement to a member cluster.
info VARCHAR The statement that the session runs, up to 1,024 bytes, with each password replaced by <secret>. Other literal values are shown as sent. NULL when the session is idle, or when the routing layer can't check a pinned session's text for credentials.
member_cluster_alias VARCHAR The member cluster that the session is bound to.
pin_status VARCHAR Pinned or Unpinned.
Where to query it

Query the table at the routing endpoint, in an unpinned session. In a pinned session, the member cluster's own process list answers instead. Filter the table with a WHERE clause. For the shapes that every system table accepts, see Filters the system tables accept.

In addition to column = 'value', router_processlist accepts the comparison operators !=, <>, <, <=, >, and >=, and conditions combined with AND, for example WHERE command = 'Query' AND time >= 60 for statements that have run for a minute or more. Each condition must have a column on the left and a literal value on the right. Unlike the other system tables, router_processlist doesn't accept a tuple equality such as (user, command) = ('app', 'Query'). The routing layer returns error 1235 for OR, IS NULL, LIKE, IN, BETWEEN, NOT, functions such as CONNECTION_ID(), and ORDER BY. Like the other system tables, router_processlist accepts LIMIT n, LIMIT n OFFSET m, and LIMIT m, n. Its rows have no fixed order, so OFFSET doesn't page through it reliably.

Ending a session

To end a session, run KILL CONNECTION with its id at the routing endpoint. It ends the session and its member cluster connections. To cancel the running statement and keep the session open, run KILL QUERY. You can end your own sessions. To end the sessions of other router users, you need dbclustergroup_connection_admin.

Example queries

The following query lists every session at the routing endpoint that you can see.

SELECT * FROM dbclustergroup_sys.router_processlist;

The following query reads one session, by its literal ID.

SELECT * FROM dbclustergroup_sys.router_processlist WHERE id = 4711;

The following query lists the open sessions of one router user.

SELECT id, user, host, db, command, time FROM dbclustergroup_sys.router_processlist WHERE user = 'app_user';

For more information, see the following topics: