tt CLI (2.6): `tt replicaset downgrade` downgrades database schema.
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Product: tt cli
Since: tt 2.6.0
Audience/target: all
Root document: https://www.tarantool.io/en/doc/latest/reference/tooling/tt_cli/replicaset/
SME: @ mandesero @ oleg-jukovec
https://github.com/tarantool/tt/pull/1031
https://github.com/tarantool/tt/issues/968
https://github.com/tarantool/tt/issues/924
Details
The tt replicaset downgrade command allows for a automate downgrade of each
replicaset in a Tarantool cluster. The process is performed sequentially on
the master instance and its replicas to ensure data consistency. Below are
the steps involved:
For Each Replicaset:
-
On the Master Instance:
- Run the following commands in sequence to downgrade the schema and take
a snapshot:box.schema.downgrade(<..version..>) box.snapshot()
- Run the following commands in sequence to downgrade the schema and take
-
On Each Replica:
- Wait for the replica to apply all transactions produced by the
box.schema.downgradecommand executed on the master. This is done
by monitoring the vector clocks (vclock) to ensure synchronization. - Once the repica has caught up, run the following command to take
a snapshot:box.snapshot()
- Wait for the replica to apply all transactions produced by the
Error Handling: If any errors occur during the downgrade process, the
operation will halt, and an error report will be generated.
- Specify the schema version for downgrade
The tt replicaset downgrade command requires specifying the target version for
the schema downgrade. This version should be provided using the --version
(or -v) option. The version must follow the x.x.x format, where x represents
a numerical value.
To view the list of available downgrade versions, execute
the following command in Tarantool:
box.schema.downgrade_versions()
Example:
$ tt replicaset downgrade [<APP_NAME> | <URI>] --version 3.0.0
- Timeout for Synchronization
Replicas will wait for synchronization for a maximum of Timeout seconds.
The default timeout is set to 5 seconds, but this can be adjusted manually
using the --timeout option.
Example:
$ tt replicaset downgrade [<APP_NAME> | <URI>] -v 3.0.0 --timeout 10
- Selecting Replicasets for Downgrade
You can specify which replicaset(s) to downgrade by using the --replicaset
or -r option to target specific replicaset names.
Example:
$ tt replicaset downgrade [<APP_NAME> | <URI>] -v 3.0.0 replicaset <RS_NAME_1> -r <RS_NAME_2> ...
This provides flexibility in downgrading only the desired parts of the cluster
without affecting the entire system.
Requested by @mandesero in https://github.com/tarantool/tt/commit/e3a74241a905199622076d35be6082d6f9e6a9f0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced root document for the tt CLI replicaset command and compare the requested behavior with PR 1031 and issues 968 and 924. Update the documentation to cover schema downgrade sequencing, version selection, synchronization timeout, replica-set selection, and error handling, with the supplied examples; done means the command behavior and options are accurately documented.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100