SHOW MASTER STATUS returns the current binary log file name and position of the primary PolarDB-X instance. Use the FULL modifier to retrieve additional performance metrics such as write throughput and replication lag.
Prerequisites
To run this statement, your account must have the SUPER or REPLICATION CLIENT privilege. For more information, see Manage accounts and permissions.
Syntax
SHOW [FULL] MASTER STATUS [WITH stream_name]| Modifier | Description |
|---|---|
FULL | Returns extended performance metrics. Requires kernel version V5.4.18 or later. |
WITH stream_name | Targets a specific stream in multi-stream mode. Omit to query single-stream mode. |
For the MySQL reference, see SHOW MASTER STATUS.
Return values
Standard fields
These fields are returned by all variants of the statement.
| Field | Description |
|---|---|
FILE | The name of the current binary log file. In multi-stream mode, the file name is prefixed with the stream name (for example, group1_stream_0#binlog.000001). |
POSITION | The current write position in the binary log file. |
BINLOG_DO_DB | Databases included in binary logging. Empty if no filter is set. |
BINLOG_IGNORE_DB | Databases excluded from binary logging. Empty if no filter is set. |
EXECUTED_GTID_SET | The set of GTIDs (Global Transaction Identifiers) that have been executed. |
Extended fields (FULL)
These fields are returned only when you use the FULL modifier (kernel version V5.4.18 or later).
| Field | Description |
|---|---|
LASTTSO | The TSO (Timestamp Oracle) of the last transaction in the binary log files. |
DELAYTIMEMS | The binary log delay. |
AVGWRITEEPS | Average number of events written to the binary log per second. |
AVGWRITEBPS | Average number of bytes written to the binary log per second. |
AVGWRITETPS | Average number of transactions written to the binary log per second. |
AVGUPLOADBPS | Average number of bytes uploaded to remote storage per second. |
AVGDUMPBPS | Average number of bytes of binlog dump per second. |
AVGREVEPS | [Needs confirmation: field appears in output but is not documented in the source.] |
AVGREVBPS | [Needs confirmation: field appears in output but is not documented in the source.] |
EXTINFO | [Needs confirmation: field appears in output but is not documented in the source.] |
Examples
Query binary log status (single-stream mode)
SHOW MASTER STATUS;Output:
*************************** 1. row ***************************
FILE: binlog.000001
POSITION: 4
BINLOG_DO_DB:
BINLOG_IGNORE_DB:
EXECUTED_GTID_SET:Query binary log status for a specific stream (multi-stream mode)
SHOW MASTER STATUS WITH 'group1_stream_0';Output:
+-------------------------------+----------+--------------+------------------+-------------------+
| FILE | POSITION | BINLOG_DO_DB | BINLOG_IGNORE_DB | EXECUTED_GTID_SET |
+-------------------------------+----------+--------------+------------------+-------------------+
| group1_stream_0#binlog.000001 | 3626808 | | | |
+-------------------------------+----------+--------------+------------------+-------------------+Query extended metrics
SHOW FULL MASTER STATUS \G;Output:
show full master status \G;
*************************** 1. row ***************************
FILE: binlog.000655
POSITION: 6889
LASTTSO: 718587571090751494417169409264603668500000000000000000
DELAYTIMEMS: 210
AVGREVEPS: 0
AVGREVBPS: 0
AVGWRITEEPS: 0
AVGWRITEBPS: 199
AVGWRITETPS: 0
AVGUPLOADBPS: 199
AVGDUMPBPS: 219
EXTINFO: