tarantool / tarantool/doc

tt CLI (2.6): `tt replicaset upgrade` upgrades database schema

Open
#4,641 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tt cli upgrade
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
Dev ticket: https://github.com/tarantool/tt/commit/d9d2545a0474318063d96149222098c0775af97c https://jira.vk.team/browse/TNTP-363

Details

tt replicaset upgrade: command to upgrade the schema on a Tarantool cluster.
-r (--replicaset): specify the replicaset name(s) to upgrade.
-t (--timeout): timeout for waiting the LSN synchronization (in seconds) (default 5).


The tt replicaset upgrade command allows for a automate upgrade 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:

    1. Run the following commands in sequence to upgrade the schema and take
      a snapshot:
      box.schema.upgrade()
      box.snapshot()
      
  • On Each Replica:

    1. Wait for the replica to apply all transactions produced by the
      box.schema.upgrade() command executed on the master. This is done
      by monitoring the vector clocks (vclock) to ensure synchronization.
    2. Once the repica has caught up, run the following command to take
      a snapshot:
      box.snapshot()
      

Error Handling: If any errors occur during the upgrade process, the
operation will halt, and an error report will be generated.


  • 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 upgrade [<APP_NAME>] --timeout 10
  • Selecting Replicasets for Upgrade

You can specify which replicaset(s) to upgrade by using the --replicaset
or -r option to target specific replicaset names.

Example:

$ tt replicaset upgrade [<APP_NAME> | <URI>] --replicaset <RS_NAME_1> -r <RS_NAME_2> ...

This provides flexibility in upgrading only the desired parts of the cluster
without affecting the entire system.
Requested by @mandesero in https://github.com/tarantool/tt/commit/d9d2545a0474318063d96149222098c0775af97c.


To be done together with #4661

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the replicaset reference at the linked root document and review #4661 before making changes. Document the tt replicaset upgrade command, its timeout and replicaset options, sequential upgrade behavior, error handling, and examples; done means the command reference covers the requested workflow accurately.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
cli, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.