trepctl offline-deferred
The trepctl offline-deferred command sets a future sequence, event, heartbeat or date/time as the trigger to
put the replicator in the OFFLINE state.
trepctl [ common-options ] offline-deferred [ options ]
Where:
| Option | Description | Version |
|---|---|---|
-at-event [event] | Go offline at the specified event. | |
-at-heartbeat [heartbeat] | Go offline when the specified heartbeat is identified. | |
-at-seqno [seqno] | Go offline at the specified sequence number. | |
-at-time [YYYY-MM-DD_hh:mm:ss] | Go offline at the specified time. |
The trepctl offline-deferred command can be used to put the replicator into an OFFLINE state at some future point in the
replication stream by identifying a specific trigger. The replicator must be ONLINE when the trepctl offline-deferred
command is given; if the replicator is not online, the command is ignored.
When running a Tungsten Cluster, placing the replicator into the OFFLINE state will only persist if you
set the cluster to MAINTENANCE first, otherwise the cluster will automatically
return the replicator to the ONLINE state
The offline process performs a clean offline event, equivalent to executing trepctl offline
The supported triggers are:
-
trepctl offline-deferred -at-seqnoSpecifies a transaction sequence number (GTID) where the replication will be stopped. For example:
shell> trepctl offline-deferred -at-seqno 3800The replicator goes into
OFFLINEat the end of the matching transaction. In the above example, sequence 3800 would be applied to the dataserver, then the replicator goes offline. -
trepctl offline-deferred -at-eventSpecifies the event where replication should stop:
shell> trepctl offline-deferred -at-event 'mysql-bin.000009:0000000000088140;0'Because there is not a one-to-one relationship between global transaction IDs and events, the replicator will go offline at a transaction that has an event ID higher than the deferred event ID. If the event specification is located within the middle of a THL transaction, the entire transaction is applied.
-
trepctl offline-deferred -at-heartbeatSpecifies the name of a specific heartbeat to look for when replication should be stopped. Also see
trepctl heartbeatfor more informationshell> trepctl offline-deferred -at-heartbeat 'dataload' -
trepctl offline-deferred -at-timeSpecifies a time (using the format YYYY-MM-DD_hh:mm:ss) at which replication should be stopped. The time must be specified in full (date and time to the second).
shell> trepctl offline-deferred -at-time 2025-02-25_00:00:00The transaction being executed at the time specified completes, then the replicator goes offline.
If any specified deferred point has already been reached, then the replicator will go offline anyway. For example, if the current sequence
number is 3800 and the deferred sequence number specified is 3700, then the replicator will go offline immediately just as if the
trepctl offline command has been used.
The status of the pending trepctl offline-deferred setting can be identified within the status output within the
offlineRequests field:
shell> trepctl status
...
offlineRequests : Offline at sequence number: 3810
...
Multiple trepctl offline-deferred commands can be given for each corresponding trigger type. For example, below three
different triggers have been specified, sequence number, time and heartbeat event, with the status showing each deferred event separated
by a semicolon:
shell> trepctl status
...
offlineRequests : Offline at heartbeat event: dataload;Offline at sequence number: 3640;Offline at time: 2025-02-25 00:00:00 EDT
...
Offline deferred settings are cleared when the replicator is put into the offline state, either manually or automatically.