The thl command supports a number of position and selection command-line options that can be used to select an individual THL event, or a range of events, to be displayed.
Valid for: thl list
Output the THL sequence for the specific sequence number. When reviewing or searching for a specific sequence number, for example when the application of a sequence on a slave has failed, the replication data for that sequence number can be individually viewed. For example:
thl list -seqno 15SEQ# = 15 / FRAG# = 0 (last frag) - FILE = thl.data.0000000001 - TIME = 2013-05-02 11:37:00.0 - EPOCH# = 7 - EVENTID = mysql-bin.000004:0000000000003345;0 - SOURCEID = host1 - METADATA = [mysql_server_id=1687011;unsafe_for_block_commit;dbms_type=mysql;» service=firstrep;shard=cheffy] - TYPE = com.continuent.tungsten.replicator.event.ReplDBMSEvent - OPTIONS = [##charset = UTF-8, autocommit = 1, sql_auto_is_null = 0, foreign_key_checks = 0, » unique_checks = 0, sql_mode = 'NO_AUTO_VALUE_ON_ZERO', character_set_client = 33, » collation_connection = 33, collation_server = 8] - SCHEMA = cheffy - SQL(0) = CREATE TABLE `access_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userid` int(10) unsigned DEFAULT NULL, `datetime` int(10) unsigned NOT NULL DEFAULT '0', ...
If the sequence number selected contains multiple fragments, each
fragment will be output. Depending on the content of the sequence
number information, the information can be output containing only the
header/metadata information or only the table data (row or SQL) that
was contained within the fragment. See
-sql for more information.
Unsigned integers are displayed and stored in the THL as their negative equivalents, and translated to the correct unsigned type when the data is applied to the target database.
Specify the start (
-low) or end
-high) of the range of
sequence numbers to be output. If only
-low is specified, then all sequence
numbers from that number to the end of the THL are output. If
-high is specified, all sequence
numbers from the start of the available log file to the specified
sequence number are output. If both numbers are specified, output all
the sequence numbers within the specified range.
thl list -low 320
thl list -from 320
Will output all the sequence number fragments from number 320.
thl list -high 540
thl list -high 540
Will output all the sequence number fragments up to and including 540.
thl list -low 320 -high 540
thl list -from 320 -to 540
Will output all the sequence number fragments from number 320 up to, and including, sequence number 540.
-first selects only the
first stored THL event. For example:
thl list -firstSEQ# = 0 / FRAG# = 0 (last frag) - TIME = 2017-06-28 13:12:38.0 - EPOCH# = 0 ...
-first # selects the
specified number of events, starting from the first event. For
thl list -first 5
Would display the first five events from the stored THL.
-last selects only the last
stored THL event. For example:
thl list -lastSEQ# = 1601 / FRAG# = 0 (last frag) - TIME = 2017-06-29 06:02:23.0 - EPOCH# = 1601 ...
The use of this option can be particularly useful in the event of synchronisation or THL corruption due to a lack of diskspace. Using the thl purge command, the last THL event can be easily removed without having to work out the ranges and index information:
thl purge -last
-last # selects the
specified number of events, starting from the last-# event. For
thl list -last 5
When the THL index contains events from 1558-1601, would display events 1597 through to 1601.