Skip to content

Commit fbc9e1e

Browse files
Document force recovery (#4446)
1 parent 0190f4e commit fbc9e1e

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Force recovery
2+
3+
A sample application demonstrating how to start an instance with a corrupted write-ahead log file.
4+
5+
## Running
6+
7+
- To start the instance using the `tt` utility, execute the following command in the [config](../../../config) directory:
8+
9+
```console
10+
$ TT_FORCE_RECOVERY=true tt start force_recovery
11+
```
12+
13+
- To start the instance using the `tarantool` command, you can use both the `TT_FORCE_RECOVERY` environment variable and add the `--force-recovery` option.
14+
In the example below, the `tarantool` command is executed in the [config/instances.enabled/force_recovery](../../../config/instances.enabled/force_recovery) directory:
15+
16+
```console
17+
$ tarantool --name instance001 --config config.yaml --force-recovery -i
18+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
groups:
2+
group001:
3+
replicasets:
4+
replicaset001:
5+
instances:
6+
instance001:
7+
iproto:
8+
listen:
9+
- uri: '127.0.0.1:3301'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
instance001:

doc/reference/tarantool_cli_options.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ Options
6565

6666
Start an external coordinator used for a :ref:`supervised failover <repl_supervised_failover>`.
6767

68+
.. _tarantool_cli_force_recovery:
69+
70+
.. option:: --force-recovery
71+
72+
**Since:** :doc:`3.0.0 </release/3.0.0>`.
73+
74+
Try to start an instance if there is an error while reading a corrupted snapshot or write-ahead log file during the recovery process:
75+
76+
- For a corrupted :ref:`snapshot file <index-box_persistence>` -- at the instance start.
77+
- For a corrupted :ref:`write-ahead log file <internals-wal>` -- at the instance start or when applying an update at a replica.
78+
79+
With this option enabled, Tarantool skips invalid records, reads as much data as possible, and lets the process finish with a warning.
80+
When the instance has started, call :ref:`box.snapshot() <box-snapshot>` to make a new snapshot so that the corrupted snapshots or write-ahead logs aren't used for recovery anymore.
81+
82+
You can also enable force recovery using the ``TT_FORCE_RECOVERY`` environment variable.
83+
``TT_FORCE_RECOVERY`` has a lower priority than the ``--force-recovery`` option.
84+
85+
Example on GitHub: `force_recovery <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/force_recovery>`_
86+
6887
.. _index-tarantool_version:
6988

7089
.. option:: -v, -V, --version

0 commit comments

Comments
 (0)