Skip to content

Commit 6a7efe9

Browse files
committed
feat(developer): add documentation for expensive repair steps
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 40c4817 commit 6a7efe9

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

developer_manual/digging_deeper/repair.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _migration-repair-steps:
2+
13
============
24
Repair steps
35
============
@@ -15,7 +17,7 @@ Creating a repair step
1517

1618
A repair step is an implementation of the ``OCP\Migration\IRepairStep`` interface.
1719
By convention these classes are placed in the **lib/Migration** directory.
18-
The following repairstep will log a message when executed.
20+
The following repair step will log a message when executed.
1921

2022
.. code-block:: php
2123
@@ -113,3 +115,22 @@ The following repair steps are available:
113115
* ``pre-migration`` This repair step will be executed just before the database is migrated during an update of the app.
114116
* ``post-migration`` This repair step will be executed just after the database is migrated during an update of the app. This repair step will also be executed when running the ``occ maintenance:repair`` command
115117
* ``live-migration`` This repair step will be scheduled to be run in the background (e.g. using cron), therefore it is unpredictable when it will run. If the job isn't required right after the update of the app and the job would take a long time this is the best choice.
118+
119+
Expensive repair steps
120+
----------------------
121+
122+
Expensive repair steps are non-critical repair steps that might take a long time to execute.
123+
Non-critical means that they are not required to directly be executed during migration to have a working instance,
124+
but they might be required to have a fully working instance later on.
125+
126+
Expensive repair steps are only executed when explicitly requested by the administrator
127+
when using the ``occ maintenance:repair`` command, by passing the ``--include-expensive`` flag.
128+
129+
.. note:: Expensive repair steps can only be used for ``post-migration`` repair steps, as the other types are executed during (un-)installation of the app and therefore should not take a long time.
130+
131+
Creating an expensive repair step
132+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133+
134+
Expensive repair steps are created the same way as normal repair steps as seen in the example above.
135+
But they have to implement the ``\OCP\Migration\IRepairStepExpensive`` interface
136+
instead of the ``\OCP\Migration\IRepairStep`` interface.

developer_manual/release_notes/new.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,16 @@ This query builder has the benefit of accurately returning the selected columns
2121
.. todo:: This linked page does not have coverage for the new API.
2222

2323
See :ref:`database` for details.
24+
25+
Expensive post migration repair steps
26+
-------------------------------------
27+
28+
``\OCP\Migration\IRepairStepExpensive`` was added and can be used to mark post-migration repair steps as expensive.
29+
30+
Expensive repair steps are non-critical repair steps that might take a long time to execute.
31+
Non-critical means that they are not required to directly be executed during migration to have a working instance,
32+
but they might be required to have a fully working instance later on.
33+
34+
Expensive repair steps are only executed when explicitly requested by the administrator.
35+
36+
See :ref:`migration-repair-steps` for details.

0 commit comments

Comments
 (0)