Skip to main content
Common Reference

The tungsten_find_orphaned Command

Applies to: Tungsten Clustering for MySQL

The tungsten_find_orphaned command assists with locating orphaned events in both the MySQL binary logs as well as in the THL.

Usage
tungsten_find_orphaned [option]

Where:

OptionDescriptionProduct
--debug
Aliases: -d
Enable additional debug output. Debug mode is VERY chatty, avoid it unless you really need it.CT
--epoch
Aliases: -e
Use the --epoch option on an OLD primary to specify the latestEpochNumber from the new primary in order to find orphaned THL which did not get copied to the new primary. Note: Use tungsten_find_orphaned -E on the new primary to obtain the latestEpochNumber (Scenario 2).CT
--epochget
Aliases: -E
Use option --epochget on a NEW primary to locate the latestEpochNumber for use on the OLD primary with--epoch (sets quiet mode to true) (Scenario 2)CT
--help
Aliases: -h
Show help text.CT
--log
Aliases: -l
Use option --log on a NEW primary specify the full path to the latest trepsvc.log file. Used whentungsten_find_orphaned is unable to auto-locate trepsvc.log (Scenario 3)CT
--new
Aliases: -n
Use option --new on a NEW primary to attempt to automatically locate the latest trepsvc.log file and determine if there is orphaned THL which exists on disk but had not yet been applied to the database. (Scenario 3)CT
--path
Aliases: -p
Specify the full path to the executable directory where the thl and trepctl commands are located.CT
--quiet
Aliases: -q
Normally, this command will output helpful text at the end of the run. Using this option will prevent that from happening.CT
--service
Aliases: -s
Specify the service name to use with the various commands.CT
--sqlOutputs the SQL statements that can be replayed. Only available from v8.0.0 onwards and can only be used with the--epoch option and with MIXED or STATEMENT based replication.CT
--thlSpecify the full path to the thl command executable file.CT
--tpmSpecify the full path to the tpm command executable file. Often used where there are multiple Tungsten installations, i.e.Multi-Site/Active-Active where there are both Cluster and Replicator binaries.CT
--trepctlSpecify the full path to the trepctl command executable file.CT
--verbose
Aliases: -v
Show verbose output.CT

This program is designed to handle three failure scenarios:

  1. Orphaned MySQL binary logs that were not extracted into THL before a failover
  2. Orphaned THL on old primaries that did not make it to the new primary
  3. Orphaned replica THL on new primaries or online replicas of the new primary that did not get applied to the database before getting promoted to new primary.

The default action with no arguments is Scenario 1 to locate orphaned MySQL binary logs which have not been extracted into THL on an old primary before recovery.

For Scenarios 1 and 2

By default, the tungsten_find_orphaned command expects to be run on a (possibly failed) primary before recovery.

Once any new replica THL is appended to any existing extracted THL, the tungsten_find_orphaned command will be unable to find the delta between the binlogs and the THL.

If any events are located in the binlogs that do not exist in the THL on disk, they will be counted, and a summary displayed at the end.

Instructions on how to display any actual orphaned events in the binary logs will be provided as well.

For Scenario 2

If the latestEpochNumber from the new primary trepctl reset output is provided via the -e option, tungsten_find_orphaned will check for THL differences from old to new primaries.

For Scenario 3

Use --new on a NEW primary to attempt to automatically locate the latest trepsvc.log file and determine if there is orphaned THL which exists on disk but had not yet been applied to the database.

If tungsten_find_orphaned is unable to auto-locate the trepsvc.log file, please specify the full path to the latest one using --log (or -l).

Examples

Run on old primary to find orphaned binary logs not extracted to thl before failover with verbose output (Scenario 1):

shell> tungsten_find_orphaned -v

Locate THL on an old primary that was not transferred to the new primary before failover (Scenario 2):

shell> tungsten_find_orphaned -v -e [latestEpochNumber_from_new_primary]

Run on new primary to find unapplied THL (Scenario 3):

shell> tungsten_find_orphaned -v -n