File tree 5 files changed +37
-4
lines changed
doc/reference/reference_lua
5 files changed +37
-4
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ Below is a list of all ``box.ctl`` functions.
53
53
* - :doc: `./box_ctl/promote `
54
54
- Wait, then choose replication leader
55
55
56
+ * - :doc: `./box_ctl/demote `
57
+ - Revoke the leader role from the instance
58
+
56
59
.. toctree ::
57
60
:hidden:
58
61
@@ -63,3 +66,4 @@ Below is a list of all ``box.ctl`` functions.
63
66
box_ctl/set_on_shutdown_timeout
64
67
box_ctl/is_recovery_finished
65
68
box_ctl/promote
69
+ box_ctl/demote
Original file line number Diff line number Diff line change
1
+ .. _box_ctl-demote :
2
+
3
+ box.ctl.demote()
4
+ =================
5
+
6
+ .. function :: demote()
7
+
8
+ Since version :doc: `2.10.0 </release/2.10.0 >`.
9
+
10
+ Revoke the leader role from the instance.
11
+
12
+ On :ref: `synchronous transaction queue owner <box_info_synchro >`, the function works in the following way:
13
+
14
+ * If :ref: `box.cfg.election_mode <cfg_replication-election_mode >` is ``off ``,
15
+ the function writes a ``DEMOTE `` request to WAL.
16
+ The ``DEMOTE `` request clears the ownership of the synchronous transaction queue,
17
+ while the ``PROMOTE `` request assigns it to a new instance.
18
+
19
+ * If :ref: `box.cfg.election_mode <cfg_replication-election_mode >` is enabled in any mode, then the function
20
+ makes the instance start a new term and give up the leader role.
21
+
22
+ On instances that are not queue owners, the function does nothing and returns immediately.
23
+
24
+ Parameters: none
25
+
26
+ :return: nil
Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ box.ctl.is_recovery_finished()
8
8
9
9
.. function :: is_recovery_finished()
10
10
11
+ Since version :doc: `2.5.3 </release/2.5.3 >`.
12
+
11
13
Check whether the :ref: `recovery process <internals-recovery_process >` has finished.
12
14
Until it has finished, space changes such as ``insert `` or ``update `` are not possible.
13
15
14
16
:return: ``true `` if recovery has finished, otherwise ``false ``
15
17
:rtype: boolean
16
-
17
- Added in release :doc: `2.5.3 </release/2.5.3 >`.
18
18
19
19
20
20
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ box.ctl.promote()
5
5
6
6
.. function :: promote()
7
7
8
+ Since version :doc: `2.6.2 </release/2.6.2 >`.
9
+ Renamed in release :doc: `2.6.3 </release/2.6.3 >`.
10
+
8
11
Wait, then choose new replication leader.
9
12
10
13
For :ref: `synchronous transactions <how-to-repl_sync >` it is
@@ -20,5 +23,3 @@ box.ctl.promote()
20
23
Parameters: none
21
24
22
25
:return: nil or function pointer
23
-
24
- Added in release :doc: `2.6.2 </release/2.6.2 >`. Renamed in release :doc: `2.6.3 </release/2.6.3 >`.
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ box.info.synchro
9
9
.. data :: synchro
10
10
11
11
Since version :doc: `2.8.1 </release/2.8.1 >`.
12
+
12
13
Show the current state of synchronous replication.
13
14
14
15
In :ref: `synchronous replication <repl_sync >`, transaction is considered committed only after achieving
@@ -26,6 +27,7 @@ box.info.synchro
26
27
To claim or reclaim the queue, use :ref: `box.ctl.promote() <box_ctl-promote >` on the instance that you want
27
28
to promote.
28
29
With elections enabled, an instance runs ``box.ctl.promote() `` command automatically after winning the elections.
30
+ To clear the ownership, call :ref: `box.ctl.demote() <box_ctl-demote >` on the synchronous queue owner.
29
31
30
32
- ``term `` (since version :doc: `2.10.0 </release/2.10.0 >`) -- current queue term.
31
33
It contains the term of the last ``PROMOTE `` request.
You can’t perform that action at this time.
0 commit comments