9.21. The tungsten_set_position Script

Version Support: 2.2.0

The script was added in Tungsten Replicator 2.2.0. It cannot be backported to older versions.

The tungsten_set_position updates the trep_commit_seqno table to reflect the given THL sequence number or provided information. It implements the Tungsten Script Interface as well as these additional options.

tungsten_set_position [ --clear-logs ] [ --epoch ] [ --event-id ] [ --high ] [ --low ] [ --offline ] [ --offline-timeout ] [ --online ] [ --replicate-statements ] [ --seqno ] [ --service ] [ --source ] [ --source-id ] [ --sql ]

Where:

Table 9.35. tungsten_set_position Command-line Options

OptionDescription
--clear-logsDelete all THL and relay logs for the service
--epochThe epoch number to use for updating the trep_commit_seqno table
--event-idThe event id to use for updating the trep_commit_seqno table
--highDisplay events ending with this sequence number
--lowDisplay events starting with this sequence number
--offlinePut required replication services offline before processing
--offline-timeoutPut required replication services offline before processing
--onlinePut required replication services online after successful processing
--replicate-statementsExecute the events so they will be replicated if the service is a master
--seqnoThe sequence number to use for updating the trep_commit_seqno table
--serviceReplication service to read information from
--sourceDetermine metadata for the --after, --low, --high statements from this host
--source-idThe source id to use for updating the trep_commit_seqno table
--sqlOnly output the SQL statements needed to update the schema

General Operation

In order to update the trep_commit_seqno table, the replication service must be offline. You may pass the --offline option to do that for you. The --online option will put the replication services back online at successful completion.

In most cases you will want to pass the --clear-logs argument so that all THL and relay logs are delete from the server following provisioning. This ensures that any corrupted or inconsistent THL records are removed prior to replication coming back online.

The --service argument is used to determine which database server should be provisioned.

This command will fail if there is more than one record in the trep_commit_seqno table. This may happen if parallel replication does not stop cleanly. You may bypass that error with the --force option.

Update trep_commit_seqno with information from a THL event

This will read the THL information from the host specified as --source.

shell> tungsten_set_position --seqno=5273 --source=db1

Update trep_commit_seqno with specific information

The script will also accept specific values to update the trep_commit_seqno table. This may be used when bringing a new master service online or when the THL event is no longer available.

shell> tungsten_set_position --seqno=5273 --epoch=5264
    --source-id=db1
shell> tungsten_set_position --seqno=5273 --epoch=5264
    --source-id=db1 --event-id=mysql-bin.000025:0000000000000421

Compatibility

The script only works with MySQL at this time.