SHOW REPLICATION STATUS
Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
On this page
Shows the list of all connections between the replication master and secondary databases.
Syntax
SHOW REPLICATION STATUS
Remarks
-
The URI identifies the database as
<host>:<port>/<dbName>
. -
Log position is the position in the transactional log formatted as
<LogFileId>:<ByteOffsetInLogFile>
. -
Each database in replicating mode has two background threads (
SecondaryNetwork
andSecondaryReplay
).The state and position of both threads are displayed per-database. The SecondaryNetwork
thread downloads the necessary snapshot files and transaction logs from the primary database and theSecondaryReplay
thread reads transactions from these files and commits them to memory. -
A row in the result table represents a replication.
It could be a replication from: master aggregator to child aggregator
master partition to a replica partition in cluster
a primary cluster to a secondary cluster
It also depends on the node where a user runs this command.
If this command is run on a leaf node, replications from one partition to another will be reported. If it is run in a master aggregator, then the db replications and cluster-db replications will be reported. -
This command can be run on any SingleStore node (see Cluster Management Commands).
-
If a sync replica is out of sync it will not appear in the output.
-
This command does not display DR clusters and the primary databases that do not have replicas.
-
The output of this command depends on the number of leaves in a cluster as explained Replication Distribution Tree.
-
Refer to the Permission Matrix for the required permission.
Output
Column |
Explanation |
---|---|
Role |
The replication role of the local database copy. |
Database |
The name of the database being replicated. |
MasterURI |
The URI for the primary database instance. |
Master_ |
The state of the primary database instance. |
Master_ |
Position in the log before which all pages have been committed. |
Master_ |
Position in the log before which all pages have been written to the disk. |
Master_ |
Position in the log before which all pages have been replayed into memory. |
Master_ |
Position in the log before which all pages have been reserved for transactions. |
MasterCommits |
The number of transactions committed on the primary database instance. |
Connected |
The current state of the connection between master and replica instances of the database. |
ReplicaURI |
The URI for the secondary database instance. |
ReplicaState |
The state of the secondary database instance. |
Replica_ |
Position in the log before which all pages have been committed. |
Replica_ |
Position in the log before which all pages have been written to the disk. |
Replica_ |
Position in the log before which all pages have been replayed into memory. |
Replica_ |
All pages that have been received from the master is below this LSN. |
ReplicaCommits |
The number of transactions committed on the secondary database instance. |
Note
This SingleStore feature is only available in SingleStore Enterprise Edition.
Example
SHOW REPLICATION STATUS;
+--------+----------+------------+--------------+------------------+--------------------+------------------+----------------+----------------+-----------+------------+--------------------------+---------------+-------------------+---------------------+-------------------+-----------------+-----------------+
| Role | Database | Master_URI | Master_State | Master_CommitLSN | Master_HardenedLSN | Master_ReplayLSN | Master_TailLSN | Master_Commits | Connected | Throttling | Replica_URI | Replica_State | Replica_CommitLSN | Replica_HardenedLSN | Replica_ReplayLSN | Replica_TailLSN | Replica_Commits |
+--------+----------+------------+--------------+------------------+--------------------+------------------+----------------+----------------+-----------+------------+--------------------------+---------------+-------------------+---------------------+-------------------+-----------------+-----------------+
| master | cluster | NULL | online | 0:239 | 0:239 | 0:233 | 0:239 | 32 | yes | no | 127.0.0.1:3307/cluster | replicating | 0:238 | 0:239 | 0:238 | 0:239 | 30 |
| master | trades | NULL | online | 0:4294967341 | 0:4294967341 | 0:4294967339 | 0:4294967341 | 39 | yes | no | 127.0.0.1:3307/trades | replicating | 0:4294967340 | 0:4294967341 | 0:4294967340 | 0:4294967341 | 38 |
+--------+----------+------------+--------------+------------------+--------------------+------------------+----------------+----------------+-----------+------------+--------------------------+---------------+-------------------+---------------------+-------------------+-----------------+-----------------+
Last modified: August 4, 2023