Skip to content

Commit b02b66e

Browse files
andreyaksenovp7novlastoCHka42TarantoolBotxuniq
authored
Release 3.0 docs (#3770)
Co-authored-by: Pavel Semyonov <[email protected]> Co-authored-by: Anna Balaeva <[email protected]> Co-authored-by: TarantoolBot <[email protected]> Co-authored-by: Kseniia Antonova <[email protected]>
1 parent ffefe88 commit b02b66e

File tree

870 files changed

+155437
-5016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

870 files changed

+155437
-5016
lines changed

.github/workflows/push-pot.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Push POTs
2+
on:
3+
push:
4+
branches:
5+
- '3.0'
6+
permissions:
7+
contents: write
8+
jobs:
9+
generate-pot:
10+
runs-on: ubuntu-latest
11+
container: tarantool/doc-builder:fat-4.3
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Generate Portable Object Templates
16+
run: |
17+
cmake .
18+
make update-pot
19+
20+
- name: Commit generated pots
21+
run: |
22+
git config --global --add safe.directory /__w/doc/doc
23+
git config --global user.name 'TarantoolBot'
24+
git config --global user.email '[email protected]'
25+
26+
if [[ $(git status) =~ .*"nothing to commit".* ]]; then
27+
echo "status=nothing-to-commit"
28+
exit 0
29+
fi
30+
31+
git add locale/en
32+
git commit -m "updated pot"
33+
git push origin 3.0
34+

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ webhooks/.env
2929

3030
locale/*
3131
!locale/ru
32+
!locale/en
3233

3334
# redundant folders created by sphinx
3435

.gitmodules

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[submodule "modules/cartridge"]
2-
path = modules/cartridge
3-
url = https://github.com/tarantool/cartridge.git
4-
[submodule "modules/cartridge-cli"]
5-
path = modules/cartridge-cli
6-
url = https://github.com/tarantool/cartridge-cli.git
71
[submodule "modules/metrics"]
82
path = modules/metrics
93
url = https://github.com/tarantool/metrics.git

build_submodules.sh

-44
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,6 @@ po_dest="${project_root}/locale/ru/LC_MESSAGES"
1212
cp README.rst doc/contributing/docs/_includes/README.rst
1313

1414

15-
# Cartridge
16-
cartridge_root="${project_root}/modules/cartridge"
17-
18-
# Build Cartridge to extract docs
19-
cd "${cartridge_root}" || exit
20-
CMAKE_DUMMY_WEBUI=true tarantoolctl rocks make
21-
22-
# Copy Cartridge docs, including diagrams and images
23-
cartridge_rst_src="${cartridge_root}/build.luarocks/build.rst"
24-
cartridge_rst_dest="${project_root}/doc/book/cartridge"
25-
cd "${cartridge_rst_src}" || exit
26-
mkdir -p "${cartridge_rst_dest}"
27-
find . -iregex '.*\.\(rst\|png\|puml\|svg\)$' -exec cp -r --parents {} "${cartridge_rst_dest}" \;
28-
29-
# Copy translation templates
30-
cartridge_pot_src="${cartridge_root}/build.luarocks/build.rst/locale"
31-
cartridge_pot_dest="${project_root}/locale/book/cartridge"
32-
cd "${cartridge_pot_src}" || exit
33-
mkdir -p "${cartridge_pot_dest}"
34-
find . -name '*.pot' -exec cp -rv --parents {} "${cartridge_pot_dest}" \;
35-
36-
# Copy translations
37-
cartridge_po_src="${cartridge_root}/build.luarocks/build.rst/locale/ru/LC_MESSAGES"
38-
cartridge_po_dest="${po_dest}/book/cartridge"
39-
cd "${cartridge_po_src}" || exit
40-
mkdir -p "${cartridge_po_dest}"
41-
find . -name '*.po' -exec cp -rv --parents {} "${cartridge_po_dest}" \;
42-
43-
44-
# Cartridge CLI
45-
cartridge_cli_root="${project_root}/modules/cartridge-cli/doc"
46-
cartridge_cli_dest="${cartridge_rst_dest}/cartridge_cli"
47-
cartridge_cli_po_dest="${po_dest}/book/cartridge/cartridge_cli"
48-
49-
# Copy Cartridge CLI docs, including diagrams and images
50-
mkdir -p "${cartridge_cli_dest}"
51-
cd ${cartridge_cli_root} || exit
52-
find . -iregex '.*\.\(rst\|png\|puml\|svg\)$' -exec cp -rv --parents {} "${cartridge_cli_dest}" \;
53-
54-
# Copy translations
55-
mkdir -p "${cartridge_cli_po_dest}"
56-
cd "${cartridge_cli_root}/locale/ru/LC_MESSAGES/doc/" || exit
57-
find . -name '*.po' -exec cp -rv --parents {} "${cartridge_cli_po_dest}" \;
58-
5915
# Monitoring
6016
monitoring_root="${project_root}/modules/metrics/doc/monitoring"
6117
monitoring_dest="${project_root}/doc/book"

conf.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
project = u'Tarantool'
6262

6363
# |release| The full version, including alpha/beta/rc tags.
64-
release = "2.11.1"
64+
release = "3.0.0"
6565
# |version| The short X.Y version.
6666
version = '.'.join(release.split('.')[0:2])
6767

@@ -73,10 +73,6 @@
7373
'how-to/using_docker.rst',
7474
'reference/configuration/cfg_*',
7575
'images',
76-
'book/cartridge/cartridge_overview.rst',
77-
'book/cartridge/CONTRIBUTING.rst',
78-
'book/cartridge/topics',
79-
'book/cartridge/cartridge_api/modules/cartridge.test-helpers.rst',
8076
'reference/reference_rock/luatest/README.rst',
8177
'reference/reference_rock/luatest/modules/luatest.rst',
8278
'**/_includes/*'

doc/alternate_build_master.rst

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
how-to/index
1515
concepts/index
1616
CRUD operations <reference/reference_lua/box_space>
17-
book/cartridge/index
1817
book/admin/index
1918
book/connectors
2019
enterprise/index
116 KB
Loading
128 KB
Loading

doc/book/admin/disaster_recovery.rst

+110-75
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,161 @@
11
.. _admin-disaster_recovery:
22

3-
================================================================================
43
Disaster recovery
5-
================================================================================
4+
=================
65

7-
The minimal fault-tolerant Tarantool configuration would be a
8-
:ref:`replication cluster<replication-topologies>`
6+
The minimal fault-tolerant Tarantool configuration would be a :ref:`replica set <replication-architecture>`
97
that includes a master and a replica, or two masters.
8+
The basic recommendation is to configure all Tarantool instances in a replica set to create :ref:`snapshot files <index-box_persistence>` on a regular basis.
109

11-
The basic recommendation is to configure all Tarantool instances in a cluster to
12-
create :ref:`snapshot files <index-box_persistence>` at a regular basis.
10+
Here are action plans for typical crash scenarios.
1311

14-
Here follow action plans for typical crash scenarios.
1512

1613
.. _admin-disaster_recovery-master_replica:
1714

18-
--------------------------------------------------------------------------------
1915
Master-replica
20-
--------------------------------------------------------------------------------
16+
--------------
2117

22-
Configuration: One master and one replica.
18+
.. _admin-disaster_recovery-master_replica_manual_failover:
2319

24-
Problem: The master has crashed.
20+
Master crash: manual failover
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2522

26-
Your actions:
23+
**Configuration:** master-replica (:ref:`manual failover <replication-master_replica_bootstrap>`).
2724

28-
1. Ensure the master is stopped for good. For example, log in to the master
29-
machine and use ``systemctl stop tarantool@<instance_name>``.
25+
**Problem:** The master has crashed.
3026

31-
2. Switch the replica to master mode by setting
32-
:ref:`box.cfg.read_only <cfg_basic-read_only>` parameter to *false* and let
33-
the load be handled by the replica (effective master).
27+
**Actions:**
3428

35-
3. Set up a replacement for the crashed master on a spare host, with
36-
:ref:`replication <cfg_replication-replication>` parameter set to replica
37-
(effective master), so it begins to catch up with the new master’s state.
38-
The new instance should have :ref:`box.cfg.read_only <cfg_basic-read_only>`
39-
parameter set to *true*.
29+
1. Ensure the master is stopped.
30+
For example, log in to the master machine and use ``tt stop``.
4031

41-
You lose the few transactions in the master
42-
:ref:`write ahead log file <index-box_persistence>`, which it may have not
43-
transferred to the replica before crash. If you were able to salvage the master
44-
.xlog file, you may be able to recover these. In order to do it:
32+
2. Configure a new replica set leader using the :ref:`<replicaset_name>.leader <configuration_reference_replicasets_name_leader>` option.
4533

46-
1. Find out the position of the crashed master, as reflected on the new master.
34+
3. Reload configuration on all instances using :ref:`config:reload() <config-module>`.
4735

48-
a. Find out instance UUID from the crashed master :ref:`xlog <internals-wal>`:
36+
4. Make sure that a new replica set leader is a master using :ref:`box.info.ro <box_introspection-box_info>`.
4937

50-
.. code-block:: console
38+
5. On a new master, :ref:`remove a crashed instance from the '_cluster' space <replication-remove_instances-remove_cluster>`.
5139

52-
$ head -5 *.xlog | grep Instance
53-
Instance: ed607cad-8b6d-48d8-ba0b-dae371b79155
40+
6. Set up a replacement for the crashed master on a spare host.
5441

55-
b. On the new master, use the UUID to find the position:
42+
See also: :ref:`Performing manual failover <replication-controlled_failover>`.
5643

57-
.. code-block:: tarantoolsession
5844

59-
tarantool> box.info.vclock[box.space._cluster.index.uuid:select{'ed607cad-8b6d-48d8-ba0b-dae371b79155'}[1][1]]
60-
---
61-
- 23425
62-
<...>
45+
.. _admin-disaster_recovery-master_replica_auto_failover:
6346

64-
2. Play the records from the crashed .xlog to the new master, starting from the
65-
new master position:
47+
Master crash: automated failover
48+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6649

67-
a. Issue this request locally at the new master's machine to find out
68-
instance ID of the new master:
50+
**Configuration:** master-replica (:ref:`automated failover <replication-bootstrap-auto>`).
6951

70-
.. code-block:: tarantoolsession
52+
**Problem:** The master has crashed.
7153

72-
tarantool> box.space._cluster:select{}
73-
---
74-
- - [1, '88580b5c-4474-43ab-bd2b-2409a9af80d2']
75-
...
54+
**Actions:**
7655

77-
b. Play the records to the new master:
56+
1. Use ``box.info.election`` to make sure a new master is elected automatically.
7857

79-
.. code-block:: console
58+
2. On a new master, :ref:`remove a crashed instance from the '_cluster' space <replication-remove_instances-remove_cluster>`.
59+
60+
3. Set up a replacement for the crashed master on a spare host.
61+
62+
See also: :ref:`Testing automated failover <replication-automated-failover-testing>`.
63+
64+
65+
.. _admin-disaster_recovery-master_replica_data_loss:
66+
67+
Data loss
68+
~~~~~~~~~
69+
70+
**Configuration:** master-replica.
71+
72+
**Problem:** Some transactions are missing on a replica after the master has crashed.
73+
74+
**Actions:**
75+
76+
You lose a few transactions in the master
77+
:ref:`write-ahead log file <index-box_persistence>`, which may have not
78+
transferred to the replica before the crash. If you were able to salvage the master
79+
``.xlog`` file, you may be able to recover these.
80+
81+
1. Find out instance UUID from the crashed master :ref:`xlog <internals-wal>`:
82+
83+
.. code-block:: console
84+
85+
$ head -5 var/lib/instance001/*.xlog | grep Instance
86+
Instance: 9bb111c2-3ff5-36a7-00f4-2b9a573ea660
87+
88+
2. On the new master, use the UUID to find the position:
89+
90+
.. code-block:: tarantoolsession
91+
92+
app:instance002> box.info.vclock[box.space._cluster.index.uuid:select{'9bb111c2-3ff5-36a7-00f4-2b9a573ea660'}[1][1]]
93+
---
94+
- 999
95+
...
96+
97+
3. :ref:`Play the records <tt-play>` from the crashed ``.xlog`` to the new master, starting from the
98+
new master position:
99+
100+
.. code-block:: console
101+
102+
$ tt play 127.0.0.1:3302 var/lib/instance001/00000000000000000000.xlog \
103+
--from 1000 \
104+
--replica 1 \
105+
--username admin --password secret
80106
81-
$ tt play <new_master_uri> <xlog_file> --from 23425 --replica 1
82107
83108
.. _admin-disaster_recovery-master_master:
84109

85-
--------------------------------------------------------------------------------
86110
Master-master
87-
--------------------------------------------------------------------------------
111+
-------------
112+
113+
**Configuration:** :ref:`master-master <replication-bootstrap-master-master>`.
114+
115+
**Problem:** one master has crashed.
88116

89-
Configuration: Two masters.
117+
**Actions:**
90118

91-
Problem: Master#1 has crashed.
119+
1. Let the load be handled by another master alone.
92120

93-
Your actions:
121+
2. Remove a crashed master from a replica set.
94122

95-
1. Let the load be handled by master#2 (effective master) alone.
123+
3. Set up a replacement for the crashed master on a spare host.
124+
Learn more from :ref:`Adding and removing instances <replication-master-master-add-remove-instances>`.
96125

97-
2. Follow the same steps as in the
98-
:ref:`master-replica <admin-disaster_recovery-master_replica>` recovery scenario
99-
to create a new master and salvage lost data.
100126

101127
.. _admin-disaster_recovery-data_loss:
102128

103-
--------------------------------------------------------------------------------
104-
Data loss
105-
--------------------------------------------------------------------------------
129+
Master-replica/master-master: data loss
130+
---------------------------------------
131+
132+
**Configuration:** master-replica or master-master.
133+
134+
**Problem:** Data was deleted at one master and this data loss was propagated to the other node (master or replica).
135+
136+
**Actions:**
137+
138+
1. Put all nodes in read-only mode.
139+
Depending on the :ref:`replication.failover <configuration_reference_replication_failover>` mode, this can be done as follows:
140+
141+
- ``manual``: change a replica set leader to ``null``.
142+
- ``election``: set :ref:`replication.election_mode <configuration_reference_replication_election_mode>` to ``voter`` or ``off`` at the replica set level.
143+
- ``off``: set ``database.mode`` to ``ro``.
106144

107-
Configuration: Master-master or master-replica.
145+
Reload configurations on all instances using the ``reload()`` function provided by the :ref:`config <config-module>` module.
108146

109-
Problem: Data was deleted at one master and this data loss was propagated to the
110-
other node (master or replica).
147+
2. Turn off deletion of expired checkpoints with :doc:`/reference/reference_lua/box_backup/start`.
148+
This prevents the Tarantool garbage collector from removing files
149+
made with older checkpoints until :doc:`/reference/reference_lua/box_backup/stop` is called.
111150

112-
The following steps are applicable only to data in memtx storage engine.
113-
Your actions:
151+
3. Get the latest valid :ref:`.snap file <internals-snapshot>` and
152+
use ``tt cat`` command to calculate at which LSN the data loss occurred.
114153

115-
1. Put all nodes in :ref:`read-only mode <cfg_basic-read_only>` and disable
116-
deletion of expired checkpoints with :doc:`/reference/reference_lua/box_backup/start`.
117-
This will prevent the Tarantool garbage collector from removing files
118-
made with older checkpoints until :doc:`/reference/reference_lua/box_backup/stop` is called.
154+
4. Start a new instance and use :ref:`tt play <tt-play>` command to
155+
play to it the contents of ``.snap`` and ``.xlog`` files up to the calculated LSN.
119156

120-
2. Get the latest valid :ref:`.snap file <internals-snapshot>` and
121-
use ``tt cat`` command to calculate at which lsn the data loss occurred.
157+
5. Bootstrap a new replica from the recovered master.
122158

123-
3. Start a new instance (instance#1) and use ``tt play`` command to
124-
play to it the contents of .snap/.xlog files up to the calculated lsn.
159+
.. NOTE::
125160

126-
4. Bootstrap a new replica from the recovered master (instance#1).
161+
The steps above are applicable only to data in the memtx storage engine.

0 commit comments

Comments
 (0)