The tungsten_find_orphaned command was added in versions 5.4.1 and 6.1.1
The tungsten_find_orphaned command assists with locating orphaned events in both the MySQL binary logs as well as in the THL.
This program is designed to handle three failure scenarios:
Orphaned MySQL binary logs that were not extracted into THL before a failover
Orphaned THL on old Primary that did not make it to the new Primary
Orphaned Replica THL on new Primary or online Replica 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 status` output is provided via the `-e {seqno}` 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).
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