@@ -22,56 +22,14 @@ on using the centralized migrations mechanism.
2222
2323``COMMAND `` is one of the following:
2424
25- * :ref: ` apply < tt-migrations-apply >`
25+
2626* :ref: `publish <tt-migrations-publish >`
27- * :ref: `remove <tt-migrations-remove >`
27+ * :ref: `apply <tt-migrations-apply >`
2828* :ref: `status <tt-migrations-status >`
2929* :ref: `stop <tt-migrations-stop >`
30+ * :ref: `remove <tt-migrations-remove >`
3031
3132
32- .. _tt-migrations-apply :
33-
34- apply
35- -----
36-
37- .. code-block :: console
38-
39- $ tt migrations apply ETCD_URI [OPTION ...]
40-
41- ``tt migrations apply `` applies :ref: `published <tt-migrations-publish >` migrations
42- to the cluster. It executes all migrations from the cluster's centralized
43- configuration storage on all its read-write instances (replica set leaders).
44-
45- .. code-block :: console
46-
47- $ tt migrations apply "https://user:pass@localhost:2379/myapp" \
48- --tarantool-username=admin --tarantool-password=pass
49-
50- To apply a single published migration, pass its name in the ``--migration `` option:
51-
52- .. code-block :: console
53-
54- $ tt migrations apply "https://user:pass@localhost:2379/myapp" \
55- --tarantool-username=admin --tarantool-password=pass \
56- --migration=000001_create_space.lua
57-
58- To apply migrations on a single replica set, specify the ``replicaset `` option:
59-
60- .. code-block :: console
61-
62- $ tt migrations apply "https://user:pass@localhost:2379/myapp" \
63- --tarantool-username=admin --tarantool-password=pass \
64- --replicaset=storage-001
65-
66- The command also provides options for migration troubleshooting: ``--ignore-order-violation ``,
67- ``--force-reapply ``, and ``--ignore-preceding-status ``. Learn to use them in
68- :ref: `centralized_migrations_tt_troubleshoot `.
69-
70- .. warning ::
71-
72- The use of migration troubleshooting options may lead to migration inconsistency
73- in the cluster. Use them only for local development and testing purposes.
74-
7533.. _tt-migrations-publish :
7634
7735publish
@@ -125,66 +83,52 @@ When publishing migrations, ``tt`` performs checks for:
12583.. warning ::
12684
12785 Using the options that ignore checks when publishing migration may cause
128- migration inconsistency in the etcd storage .
86+ migration inconsistency in the cluster .
12987
130- .. _tt-migrations-remove :
13188
132- remove
133- ------
89+ .. _tt-migrations-apply :
13490
135- .. code-block :: console
91+ apply
92+ -----
13693
137- $ tt migrations remove ETCD_URI [OPTION ...]
94+ .. code-block :: console
13895
139- ``tt migrations remove `` removes published migrations from the centralized storage.
140- With additional options, it can also remove the information about the migration execution
141- on the cluster instances.
96+ $ tt migrations apply ETCD_URI [OPTION ...]
14297
143- To remove all migrations from a specified centralized storage:
98+ ``tt migrations apply `` applies :ref: `published <tt-migrations-publish >` migrations
99+ to the cluster. It executes all migrations from the cluster's centralized
100+ configuration storage on all its read-write instances (replica set leaders).
144101
145102.. code-block :: console
146103
147- $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
148- --tarantool-username=admin --tarantool-password=pass
104+ $ tt migrations apply "https://user:pass@localhost:2379/myapp" \
105+ --tarantool-username=admin --tarantool-password=pass
149106
150- To remove a specific migration, pass its name in the ``--migration `` option:
107+ To apply a single published migration, pass its name in the ``--migration `` option:
151108
152109.. code-block :: console
153110
154- $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
155- --tarantool-username=admin --tarantool-password=pass \
156- --migration=000001_create_writers_space .lua
111+ $ tt migrations apply "https://user:pass@localhost:2379/myapp" \
112+ --tarantool-username=admin --tarantool-password=pass \
113+ --migration=000001_create_space .lua
157114
158- Before removing migrations, the command checks their :ref: `status <tt-migrations-status >`
159- on the cluster. To ignore the status and remove migrations anyway, add the
160- ``--force-remove-on=config-storage `` option:
115+ To apply migrations on a single replica set, specify the ``replicaset `` option:
161116
162117.. code-block :: console
163118
164- $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
165- --force-remove-on=config-storage
166-
167- .. note ::
168-
169- In this case, cluster credentials are not required.
170-
171- To remove migration execution information from the cluster (clear the migration status),
172- use the ``--force-remove-on=cluster `` option:
173-
174- .. code-block :: console
119+ $ tt migrations apply "https://user:pass@localhost:2379/myapp" \
120+ --tarantool-username=admin --tarantool-password=pass \
121+ --replicaset=storage-001
175122
176- $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
177- --tarantool-username=admin --tarantool-password=pass \
178- --force-remove-on=cluster
123+ The command also provides options for migration troubleshooting: `` --ignore-order-violation ``,
124+ `` --force-reapply ``, and `` --ignore-preceding-status ``. Learn to use them in
125+ :ref: ` centralized_migrations_tt_troubleshoot `.
179126
180- To clear all migration information from the centralized storage and cluster,
181- use the ``--force-remove-on=all `` option:
127+ .. warning ::
182128
183- .. code-block :: console
129+ The use of migration troubleshooting options may lead to migration inconsistency
130+ in the cluster. Use them only for local development and testing purposes.
184131
185- $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
186- --tarantool-username=admin --tarantool-password=pass \
187- --force-remove-on=all
188132
189133.. _tt-migrations-status :
190134
@@ -201,6 +145,7 @@ storage and the result of their execution on the cluster instances.
201145Possible migration statuses are:
202146
203147- ``APPLY_STARTED `` -- the migration execution has started but not completed yet
148+ or has been interrupted with :ref: `tt migrations stop <tt-migrations-stop >``
204149- ``APPLIED `` -- the migration is successfully applied on the instance
205150- ``FAILED `` -- there were errors during the migration execution on the instance
206151
@@ -254,16 +199,76 @@ stop
254199
255200 Calling ``tt migration stop `` may cause migration inconsistency in the cluster.
256201
257- To stop execution of migrations currently running in the cluster:
202+ To stop the execution of a migration currently running in the cluster:
258203
259204.. code-block :: console
260205
261206 $ tt migrations stop "https://user:pass@localhost:2379/myapp" \
262207 --tarantool-username=admin --tarantool-password=pass
263208
264- Q: can any migrations in a batch complete successfully? If I apply 2 migrations and call
265- `tt migrations stop ` after the first one is finished without errors, what are migration statuses?
209+ ``tt migrations stop `` interrupts a single migration. If you call it to interrupt
210+ the process that applies multiple migrations, the ones completed before the call
211+ receive the ``APPLIED `` status. The migration is interrupted by the call remains in
212+ ``APPLY_STARTED ``.
213+
214+ .. _tt-migrations-remove :
215+
216+ remove
217+ ------
218+
219+ .. code-block :: console
220+
221+ $ tt migrations remove ETCD_URI [OPTION ...]
222+
223+ ``tt migrations remove `` removes published migrations from the centralized storage.
224+ With additional options, it can also remove the information about the migration execution
225+ on the cluster instances.
226+
227+ To remove all migrations from a specified centralized storage:
228+
229+ .. code-block :: console
230+
231+ $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
232+ --tarantool-username=admin --tarantool-password=pass
233+
234+ To remove a specific migration, pass its name in the ``--migration `` option:
235+
236+ .. code-block :: console
237+
238+ $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
239+ --tarantool-username=admin --tarantool-password=pass \
240+ --migration=000001_create_writers_space.lua
241+
242+ Before removing migrations, the command checks their :ref: `status <tt-migrations-status >`
243+ on the cluster. To ignore the status and remove migrations anyway, add the
244+ ``--force-remove-on=config-storage `` option:
245+
246+ .. code-block :: console
247+
248+ $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
249+ --force-remove-on=config-storage
266250
251+ .. note ::
252+
253+ In this case, cluster credentials are not required.
254+
255+ To remove migration execution information from the cluster (clear the migration status),
256+ use the ``--force-remove-on=cluster `` option:
257+
258+ .. code-block :: console
259+
260+ $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
261+ --tarantool-username=admin --tarantool-password=pass \
262+ --force-remove-on=cluster
263+
264+ To clear all migration information from the centralized storage and cluster,
265+ use the ``--force-remove-on=all `` option:
266+
267+ .. code-block :: console
268+
269+ $ tt migrations remove "https://user:pass@localhost:2379/myapp" \
270+ --tarantool-username=admin --tarantool-password=pass \
271+ --force-remove-on=all
267272
268273 .. _tt-migrations-auth :
269274
@@ -273,10 +278,10 @@ Authentication
273278Since ``tt migrations `` operates migrations via a centralizes etcd storage, it
274279needs credentials to access this storage. There are two ways to pass etcd credentials:
275280
276- - command options ``--config-storage-username `` and ``--config-storage-password ``
281+ - command-line options ``--config-storage-username `` and ``--config-storage-password ``
277282- the etcd URI, for example, ``https://user:pass@localhost:2379/myapp ``
278283
279- Q: which way has a higher priority?
284+ Credentials specified in the URI have a higher priority.
280285
281286For commands that connect to the cluster (that is, all except ``publish ``), Tarantool
282287credentials are also required. The are passed in the ``--tarantool-username `` and
@@ -386,7 +391,7 @@ Options
386391
387392 **Applicable to: ** ``apply ``, ``remove ``, ``status ``
388393
389- migration to remove
394+ A migration to apply, remove, or check status.
390395
391396.. option :: --overwrite
392397
0 commit comments