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-directory
] [ --source-id
] [ --sql
]
Where:
Table 8.48. tungsten_set_position Command-line Options
Option | Description |
---|---|
--clear-logs | Delete all THL and relay logs for the service |
--epoch | The epoch number to use for updating the trep_commit_seqno table |
--event-id | The event id to use for updating the trep_commit_seqno table |
--high | Display events ending with this sequence number |
--low | Display events starting with this sequence number |
--offline | Put required replication services offline before processing |
--offline-timeout | Put required replication services offline before processing |
--online | Put required replication services online after successful processing |
--replicate-statements | Execute the events so they will be replicated if the service is a Primary |
--seqno | The sequence number to use for updating the trep_commit_seqno table |
--service | Replication service to read information from |
--source | Determine metadata for the --after, --low, --high statements from this host |
--source-directory | Directory on --source to find installed software |
--source-id | The source id to use for updating the trep_commit_seqno table |
--sql | Only 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.
If the installation directory on
--source
is different
from the target, specify
--source-directory
to
specify where it can be found. This option should point to an installation
that is running the
--service
replication
service. The
--source-directory
option is not required if the software is installed to the same directory on
both servers.
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 Primary 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.