All Products
Search
Document Center

PolarDB:SHOW SLAVE STATUS

Last Updated:Mar 28, 2026

SHOW SLAVE STATUS returns the status of one or all primary/secondary replication links created by CHANGE MASTER TO. Use it to check replication health, diagnose lag, and inspect replication positions.

Syntax

SHOW SLAVE STATUS [ channel_option ]

channel_option:
    FOR CHANNEL channel

SLAVE and REPLICA are interchangeable in this statement. SHOW REPLICA STATUS produces identical results.

Usage notes

  • Run this statement with a privileged account on the current instance.

  • With FOR CHANNEL channel: returns status for the named replication link only.

  • Without FOR CHANNEL: returns status for all primary/secondary replication links on the current instance.

Example

The following statement returns the status of a replication link named aaa:

SHOW SLAVE STATUS FOR CHANNEL 'aaa';

Output:

SHOW SLAVE STATUS\G
*************************** 1. row ***************************
                  Master_Host: 127.0.0.1
                  Master_User: polardbxtest
                  Master_Port: 3036
              Master_Log_File: binlog.000001
          Read_Master_Log_Pos: 17300738
               Relay_Log_File: binlog.000001
                Relay_Log_Pos: 17300738
        Relay_Master_Log_File: binlog.000001
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Error:
          Exec_Master_Log_Pos: 17300738
          Exec_Master_Log_Tso: 7186584608278839360
              Until_Condition: None
           Master_SSL_Allowed: No
        Seconds_Behind_Master: 27
Master_SSL_Verify_Server_Cert: No
  Replicate_Ignore_Server_Ids:
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Yes
                Auto_Position: 0
         Replicate_Rewrite_DB:
               Replicate_Mode: INCREMENTAL
                Running_Stage: REPLICA_INC_CATCH_UP
         Replicate_Enable_Ddl: true
                     Skip_Tso:
               Skip_Until_Tso:
                   Write_Type: SPLIT
            Conflict_Strategy: OVERWRITE
     Source_Stream_Group_Name:
                 Channel_Name: aaa
             Sub_Channel_Name: 1
1 row in set (0.01 sec)

Output field reference

Replication thread status

FieldDescription
Slave_IO_RunningWhether the I/O thread that reads events from the source is running. Yes means the thread is active and connected. No means the thread has stopped.
Slave_SQL_RunningWhether the SQL thread that applies events to the local instance is running. Yes means the thread is active. No means the thread has stopped.
Slave_SQL_Running_StateCurrent state of the SQL thread. Yes means the thread is running normally. No means the thread is not running.

Replication position

FieldDescription
Relay_Master_Log_FileThe binlog file on the source that contains the current replication position.
Read_Master_Log_PosThe position in Relay_Master_Log_File up to which the I/O thread has read.
Exec_Master_Log_PosThe position in Relay_Master_Log_File up to which the SQL thread has applied events.
Exec_Master_Log_TsoThe upstream Timestamp Oracle (TSO) value corresponding to the current replication position. This is a PolarDB for Xscale extension.

Replication delay

FieldDescription
Seconds_Behind_MasterThe replication delay in seconds — the difference between the timestamp of the event being applied and the current time on the replica. 0 means replication is caught up. NULL means the SQL thread is not running.
SQL_Remaining_DelayWhen CHANGE MASTER TO MASTER_DELAY is set, the number of seconds remaining before the delayed event is applied. NULL when no delay is configured.

PolarDB for Xscale-specific fields

FieldDescription
Replicate_ModeThe replication mode. INCREMENTAL means the link applies incremental changes from the source.
Running_StageThe current operational stage of the replication link. REPLICA_INC_CATCH_UP means the replica is catching up with the source through incremental replication.
Write_TypeHow replicated data is written to the replica. SPLIT distributes write operations for parallel processing.
Conflict_StrategyHow write conflicts are resolved when the same row is modified on both sides. OVERWRITE means the incoming change overwrites the existing data.
Sub_Channel_NameThe sub-channel identifier within the named channel.

Error information

FieldDescription
Last_ErrorThe most recent error reported for this replication link. An empty value means no errors have occurred.

Channel identification

FieldDescription
Channel_NameThe name of the replication channel, as specified in CHANGE MASTER TO.

Fields from CHANGE MASTER TO

The following fields reflect the configuration set by CHANGE MASTER TO. Refer to that statement's documentation for field definitions.

  • Master_Host

  • Master_User

  • Master_Port

  • Master_Log_File

  • Write_Type

  • Replicate_Mode

  • Conflict_Strategy

  • Replicate_Ignore_Server_Ids

  • Source_Stream_Group_Name

  • Channel_Name

Fields from CHANGE REPLICATION FILTER

The following fields reflect the filter rules set by CHANGE REPLICATION FILTER. Refer to that statement's documentation for field definitions.

  • Replicate_Do_DB

  • Replicate_Ignore_DB

  • Replicate_Do_Table

  • Replicate_Ignore_Table

  • Replicate_Wild_Do_Table

  • Replicate_Wild_Ignore_Table

  • Replicate_Enable_Ddl

  • Skip_Tso

  • Skip_Until_Tso