Use ttRepAdmin to Show Replication Status
The output from ttRepAdmin
-showstatus
includes the status of the main thread and the
TRANSMITTER
and RECEIVER
threads used by the replication
agent.
A master database has a TRANSMITTER
thread and a subscriber
database has a RECEIVER
thread. A database that serves a master/subscriber
role in a bidirectional replication scheme has both a TRANSMITTER
and a
RECEIVER
thread.
Each replication agent has a single REPLISTENER
thread that listens on a port for peer connections. On a master database, the REPLISTENER
thread starts a separate TRANSMITTER
thread for each subscriber database. On a subscriber database, the REPLISTENER
thread starts a separate RECEIVER
thread for each connection from a master.
If the TimesTen daemon requests that the replication agent stop or if a fatal error occurs in any of the other threads used by the replication agent, the main thread waits for the other threads to gracefully terminate. The TimesTen daemon may or may not restart the replication agent, depending upon certain fatal errors. The REPLISTENER
thread never terminates during the lifetime of the replication agent. A TRANSMITTER
or RECEIVER
thread may stop but the replication agent may restart it. The RECEIVER
thread terminates on errors from which it cannot recover or when the master disconnects.
The following example demonstrates the ttRepAdmin
-showstatus
output.
Following the examples are sections that describe the meaning of each field in the ttRepAdmin
-showstatus
output:
The following example is an active standby pair replication scheme in which the rep1
database is the active master and rep2
database is the standby master in an active standby pair replication scheme.
The ReplicationParallelism
connection attribute in this example is set to 2, which indicates the number of transmitter threads on the source database and the number of receiver threads on the target database.
$ ttRepAdmin -showstatus -detail rep1 Replication Agent Status as of: 2019-09-03 10:01:31 DSN : rep1 Process ID : 9012 (Started) Replication Agent Policy : manual Host : MYHOST RepListener Port : 56209 (AUTO) Main thread's state : STATE_MM_IDLE_STATE Last write LSN : 0.22169832 Last LSN forced to disk : 0.22169600 Replication hold LSN : 0.22159592
Note that the Replication hold LSN
, the Last write LSN
and the Last LSN
forced to disk are very close, which indicates that replication is operating satisfactorily. If the Replication hold LSN
falls behind the Last write LSN
and the Last LSN
, then replication is not keeping up with updates to the master.
Replication Peers: Name : REP2 Host : MYHOST2 Port : 51509 (AUTO) (Connected) Replication State : STARTED Communication Protocol : 47 Name : REP2 Host : MYHOST2 Port : 51509 (AUTO) (Connected) Replication State : STARTED Communication Protocol : 47
Since ReplicationParallelism
is set to 2, there are two entries for the replication peer for rep2
.
REPHOLD thread (REPHOLD:140175402608384): Start/Restart count : 1 Current state : STATE_REPHOLD_SLEEPING Current DB context : 0x7f7d180008c0 REPLISTENER thread (REPLISTENER:140175393158912): Start/Restart count : 1 Current state : STATE_LISTENER_WAIT_FOR_PEER_CONN Current DB context : 0x7f7c9c0008c0 Most recent errors (max 5): TT16999 in receiver.c (line 2608) at 09:55:38 on 09-03-2019 TT16999 in receiver.c (line 2608) at 09:55:55 on 09-03-2019 LOGFORCE thread (LOGFORCE:140175407265536): Start/Restart count : 1 Current state : STATE_LOGFORCE_SLEEPING Current DB context : 0x7f7d140afae0
With an active standby pair, each master has both transmitters to and receivers from the other master. The number of transmitters and receivers determined by the ReplicationParallelism
setting. In this example, since ReplicationParallelism
is set to 2, there are two transmitter and receiver threads between the active and standby masters, shown as track 0 and track 1 in the output.
TRANSMITTER thread(s) (TRANSMITTER(S):140172775343872): For : REP2 (track 1)(SSL) Start/Restart count : 1 Current state : STATE_XMTR_FLUSH_SENDING_DONE Current DB context : 0x7f7ca44ff640 Send LSN : 0.22159592 Replication Tables CTN: 1567529721.542 Transactions sent : 101 Total packets sent : 36 Tick packets sent : 25 MIN sent packet size : 64 MAX sent packet size : 16384 AVG sent packet size : 876 Last packet sent at : 10:01:26 Total Packets received: 34 MIN rcvd packet size : 64 MAX rcvd packet size : 128 AVG rcvd packet size : 119 Last packet rcvd'd at : 10:01:26 TXNs Allocated : 102 TXNs In Use : 0 ACTs Allocated : 101 ACTs In Use : 0 ACTs Data Allocated : 0 Timeout : 7200 Adapted Timeout Max : 7200 Adapted Timeout Time : 1567530021 current txn : 0.0 Longest batch runtime : 0 Longest batch 1st txn : 0.0 Longest batch lst txn : 0.0 Largest txn (ops) : 1567529721.441 Largest txn (#ops) : 1 Longest txn (time) : 0.0 Longest txn (secs) : 0 Most recent errors (max 5): TT16999 in transmitter.c (line 1465) at 09:55:56 on 09-03-2019 RECEIVER thread(s) (RECEIVER:140173241992960): For : REP2 (track 1)(SSL) Start/Restart count : 1 Current state : STATE_RCVR_READ_NETWORK_LOOP Current DB context : 0x7f7c9c4b0b90 Transactions received : 0 Total packets sent : 28 Tick packets sent : 0 MIN sent packet size : 64 MAX sent packet size : 128 AVG sent packet size : 122 Last packet sent at : 10:01:19 Total Packets received: 29 MIN rcvd packet size : 64 MAX rcvd packet size : 156 AVG rcvd packet size : 68 Last packet rcvd'd at : 10:01:19 rxWaitCTN : 0.0 prevCTN : 0.0 current txn : 0.0 STA Blk Data Allocated: 0 STA Data Allocated : 0 Longest batch runtime : 0 Longest batch 1st txn : 0.0 Longest batch lst txn : 0.0 Largest txn (ops) : 0.0 Largest txn (#ops) : 0 Longest txn (time) : 0.0 Longest txn (secs) : 0 TRANSMITTER thread(s) (TRANSMITTER(M):140175390009088): For : REP2 (track 0)(SSL) Start/Restart count : 1 Current state : STATE_META_PEER_INFO Current DB context : 0x7f7c980008c0 Send LSN : 0.22159592 Replication Tables CTN: 1567529721.386 Transactions sent : 100 Total packets sent : 88 Tick packets sent : 74 MIN sent packet size : 64 MAX sent packet size : 16384 AVG sent packet size : 394 Last packet sent at : 10:01:26 Total Packets received: 86 MIN rcvd packet size : 64 MAX rcvd packet size : 128 AVG rcvd packet size : 123 Last packet rcvd'd at : 10:01:26 TXNs Allocated : 101 TXNs In Use : 0 ACTs Allocated : 100 ACTs In Use : 0 ACTs Data Allocated : 0 Timeout : 7200 Adapted Timeout Max : 7200 Adapted Timeout Time : 1567529956 current txn : 0.0 Longest batch runtime : 0 Longest batch 1st txn : 0.0 Longest batch lst txn : 0.0 Largest txn (ops) : 1567529721.286 Largest txn (#ops) : 1 Longest txn (time) : 0.0 Longest txn (secs) : 0 Most recent errors (max 5): TT16999 in transmitter.c (line 1465) at 09:55:38 on 09-03-2019 RECEIVER thread(s) (RECEIVER:140173245142784): For : REP2 (track 0)(SSL) Start/Restart count : 1 Current state : STATE_RCVR_READ_NETWORK_LOOP Current DB context : 0x7f7c944a41f0 Transactions received : 0 Total packets sent : 79 Tick packets sent : 0 MIN sent packet size : 64 MAX sent packet size : 128 AVG sent packet size : 125 Last packet sent at : 10:01:29 Total Packets received: 80 MIN rcvd packet size : 64 MAX rcvd packet size : 156 AVG rcvd packet size : 65 Last packet rcvd'd at : 10:01:29 rxWaitCTN : 0.0 prevCTN : 0.0 current txn : 0.0 STA Blk Data Allocated: 0 STA Data Allocated : 0 Longest batch runtime : 0 Longest batch 1st txn : 0.0 Longest batch lst txn : 0.0 Largest txn (ops) : 0.0 Largest txn (#ops) : 0 Longest txn (time) : 0.0 Longest txn (secs) : 0
MAIN Thread Status Fields
The MAIN
thread status fields are output for the
MAIN
thread in the replication agent for the queried
database.
MAIN Thread | Description |
---|---|
|
Name of the database to be queried. |
|
Process Id of the replication agent. |
|
The restart policy, as described in Starting and Stopping the Replication Agents |
|
Name of the machine that hosts this database. |
|
TCP/IP port used by the replication agent to listen for connections from the |
|
Internal use only. |
|
The location of the most recently generated transaction log record for the database. See Show Replicated Log Records. |
|
The location of the most recent transaction log record written to the disk. See Show Replicated Log Records. |
|
The location of the lowest (or oldest) record held in the log for possible
transmission to a subscriber. A value of -1/-1 indicates replication
is in the |
Replication Peer Status Fields
The replication peer status fields are output for each replication peer that participates in the replication scheme with the queried database. A "peer" could play the role of master, subscriber, propagator or both master and subscriber in a bidirectional replication scheme.
Replication Peers | Description |
---|---|
|
Name of a database that is a replication peer to this database. |
|
Host of the peer database. |
|
TCP/IP port used by the replication agent for the peer database. A value of 0 indicates this port has been assigned automatically to the replication agent (the default), rather than being specified as part of a replication scheme. |
|
Current replication state of the replication peer with respect to the queried database See Show Subscriber Database Information. |
|
Internal protocol used by replication to communicate between the peers. (For internal use only.) |
Note:
The REPHOLD
, REPLISTENER
and LOGFORCE
thread sections are for internal use only.
TRANSMITTER Thread Status Fields
The TRANSMITTER
thread status fields are output for each
TRANSMITTER
thread used by a master replication agent to send
transaction updates to a subscriber. A master with multiple subscribers has multiple
TRANSMITTER
threads.
Note:
The counts in the TRANSMITTER
output begin to accumulate when the replication agent is started. These counters are reset to 0 only when the replication agent is started or restarted.
TRANSMITTER Thread | Description |
---|---|
|
Name of the subscriber database that is receiving replicated data from this database. Also, whether the replication agent transmitters are using Transport Layer Security (TLS) (indicated with "SSL"). |
|
Number of times this |
|
Internal use only. |
|
Internal use only. |
|
The last LSN transmitted to this peer. See Show Replicated Log Records. |
|
Internal use only. |
|
Total number of transactions sent to the subscriber. |
|
Total number of packets sent to the subscriber (including tick packets). |
|
Total number of tick packets sent. Tick packets are used to maintain a "heartbeat" between the master and subscriber. You can use this value to determine how many of the 'Total packets sent' packets are not related to replicated data. |
|
Size of the smallest packet sent to the subscriber. |
|
Size of the largest packet sent to the subscriber. |
|
Average size of the packets sent to the subscriber. |
|
Time of day last packet was sent (24-hour clock time). |
|
Total packets received from the subscriber (tick packets and acknowledgement data). |
|
Size of the smallest packet received. |
|
Size of the largest packet received. |
|
Average size of the packets received. |
|
Time of day last packet was received (24-hour clock time). |
|
Internal use only. |
|
Number of operations. |
|
Amount of time in seconds taken to process the longest transaction. |
|
Last five errors generated by this thread. |
RECEIVER Thread Status Fields
The RECEIVER
thread status fields are output for each
RECEIVER
thread used by a subscriber replication agent to receive
transaction updates from a master. A subscriber that is updated by multiple masters has
multiple RECEIVER
threads.
Note:
The counts in the RECEIVER
output begin to accumulate when the replication agent is started. These counters are reset to 0 only when the replication agent is started or restarted.
RECEIVER Thread | Description |
---|---|
|
Name of the master database that is sending replicated data from this database. Also, whether the replication agent receivers are using Transport Layer Security (TLS) (indicated with "SSL"). |
|
Number of times this |
|
Internal use only. |
|
Internal use only. |
|
Total number of transactions received from the master. |
|
Total number of packets sent to the master (tick packets and acknowledgement data). |
|
Total number of tick packets sent to the master. Tick packets are used to maintain a "heartbeat" between the master and subscriber. You can use this value to determine how many of the 'Total packets sent' packets are not related to acknowledgement data. |
|
Size of the smallest packet sent to the master. |
|
Size of the largest packet sent to the master. |
|
Average size of the packets sent to the master. |
|
Time of day last packet was sent to the master (24-hour clock time). |
|
Total packets of acknowledgement data received from the master. |
|
Size of the smallest packet received. |
|
Size of the largest packet received. |
|
Average size of the packets received. |
|
Time of day last packet was received (24-hour clock time). |
|
Internal use only. |
|
Number of operations. |
|
Amount of time in seconds taken to process the longest transaction. |