The trepctl offline-deferred sets a future sequence, event or heartbeat as the trigger to put the replicator in the offline state.
trepctl offline-deferred [
-at-event event ] [
-at-heartbeat [heartbeat] ] [
-at-seqno seqno ] [
-at-time YYYY-MM-DD_hh:mm:ss ]
Table 8.44. trepctl offline-deferred Command Options
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.
The supported triggers are:
Specifies a transaction sequence number (GTID) where the replication will be stopped. For example:
trepctl offline-deferred -at-seqno 3800
The replicator goes into offline at the end of the matching transaction. In the above example, sequence 3800 would be applied to the dataserver, then the replicator goes offline.
Specifies the event where replication should stop:
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.
Specifies the name of a specific heartbeat to look for when replication should be stopped.
Specifies 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).
trepctl offline-deferred -at-time 2013-09-01_00:00:00
The 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.
When a trigger is reached, For example if a sequence number is given, that sequence will be applied and then the replicator will go offline.
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:
trepctl status... offlineRequests : Offline at heartbeat event: dataloaded;Offline at » sequence number: 3640;Offline at time: 2013-09-01 00:00:00 EDT
Offline deferred settings are cleared when the replicator is put into the offline state, either manually or automatically.