Skip to content

Commit a22f697

Browse files
committed
[#3344] Addressed review comments (doc)
1 parent 8cd15d3 commit a22f697

File tree

4 files changed

+63
-25
lines changed

4 files changed

+63
-25
lines changed

doc/sphinx/arm/ctrl-channel.rst

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -714,16 +714,28 @@ if the :isccmd:`dhcp-enable` command is not sent before this time elapses.
714714
Since Kea 1.9.4, there is an additional ``origin`` parameter that specifies the
715715
command source. A server administrator should typically omit this parameter
716716
because the default value "user" indicates that the administrator sent the
717-
command. This command can also be sent by the partner server running HA hooks
718-
library. In that case, the partner server sets the parameter to a unique
719-
integer identifier of an HA service. The integer values are reserved for the
720-
communication between HA partners and should not be specified in the
721-
administrator's commands, as it may interfere with HA operation. The
722-
administrator should either omit this parameter or set it to "user".
717+
command. In Kea 2.5.5 thru 2.5.7 this parameter was also used in communication
718+
between the HA partners to specify the identifier of an HA service sending the command
719+
in a numeric format. However, due to the compatibility issues with the older
720+
Kea versions that did not properly parse the numeric values, it was necessary
721+
to introduce the new parameter, ``origin-id``, in Kea 2.5.8.
723722

724-
Introduction of ``origin-id`` in Kea 2.5.8 deprecates the use of the ``origin`` parameter
725-
in the messages exchanged between the Kea HA partners. The ``origin-id`` parameter
726-
must not be used in messages sent by the user.
723+
It holds a numeric value representing the origin of the command. The same value
724+
can still be passed using the ``origin`` parameter, but it can cause the
725+
aforementioned compatibility issues between the HA partners running different
726+
Kea versions. Therefore, new Kea versions favor using ``origin-id`` in communication
727+
between the HA partners. The ``origin`` parameter can still be used, but the
728+
``origin-id`` takes precedence. Overall, it is recommended that both parameters be
729+
omitted from the user commands.
730+
731+
The following codes represent the supported origins in numeric format:
732+
733+
- ``1`` - a user command, same as specifying ``"origin": "user"``,
734+
- ``2000``, ``2001``, ``2002`` etc. - origins specified by HA partners where
735+
the increments above ``2000`` are distinct HA service identifiers used when
736+
the partners have many relationships.
737+
738+
In the following example:
727739

728740
::
729741

@@ -736,6 +748,10 @@ must not be used in messages sent by the user.
736748
}
737749
}
738750

751+
the effective origin will be ``2002`` which indicates it is an HA partner
752+
sending the command for the service with ID of ``2``. The ``origin``
753+
parameter will be ignored in this case.
754+
739755
.. isccmd:: dhcp-enable
740756
.. _command-dhcp-enable:
741757

@@ -747,27 +763,44 @@ The :isccmd:`dhcp-enable` command globally enables the DHCP service.
747763
Since Kea 1.9.4, there is an additional ``origin`` parameter that specifies the
748764
command source. A server administrator should typically omit this parameter
749765
because the default value "user" indicates that the administrator sent the
750-
command. This command can also be sent by the partner server running the HA hook
751-
library. In that case, the partner server sets the parameter to a unique
752-
integer identifier of an HA service. The integer values are reserved for the
753-
communication between HA partners and should not be specified in the
754-
administrator's commands, as it may interfere with HA operation. The
755-
administrator should either omit this parameter or set it to
756-
"user".
757-
758-
Introduction of ``origin-id`` deprecates the use of the ``origin`` parameter
759-
in the messages exchanged between the Kea HA partners. The ``origin-id`` parameter
760-
must not be used in messages sent by the user.
766+
command. In Kea 2.5.5 thru 2.5.7 this parameter was also used in communication
767+
between the HA partners to specify the identifier of an HA service sending the command
768+
in a numeric format. However, due to the compatibility issues with the older
769+
Kea versions that did not properly parse the numeric values, it was necessary
770+
to introduce the new parameter, ``origin-id``, in Kea 2.5.8.
771+
772+
It holds a numeric value representing the origin of the command. The same value
773+
can still be passed using the ``origin`` parameter, but it can cause the
774+
aforementioned compatibility issues between the HA partners running different
775+
Kea versions. Therefore, new Kea versions favor using ``origin-id`` in communication
776+
between the HA partners. The ``origin`` parameter can still be used, but the
777+
``origin-id`` takes precedence. Overall, it is recommended that both parameters be
778+
omitted from the user commands.
779+
780+
The following codes represent the supported origins in numeric format:
781+
782+
- ``1`` - a user command, same as specifying ``"origin": "user"``,
783+
- ``2000``, ``2001``, ``2002`` etc. - origins specified by HA partners where
784+
the increments above ``2000`` are distinct HA service identifiers used when
785+
the partners have many relationships.
786+
787+
In the following example:
761788

762789
::
763790

764791
{
765792
"command": "dhcp-enable",
766793
"arguments": {
794+
"origin-id": 2002,
767795
"origin": "user"
768796
}
769797
}
770798

799+
the effective origin will be ``2002`` which indicates it is an HA partner
800+
sending the command for the service with ID of ``2``. The ``origin``
801+
parameter will be ignored in this case.
802+
803+
771804
.. isccmd:: status-get
772805
.. _command-status-get:
773806

src/hooks/dhcp/high_availability/command_creator.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ CommandCreator::createSyncCompleteNotify(const unsigned int origin_id,
267267
auto args = Element::createMap();
268268
args->set("server-name", Element::create(server_name));
269269
args->set("origin-id", Element::create(origin_id));
270-
// Add for backward compatibility with Kea 2.5.5.
270+
// Add for backward compatibility with Kea 2.5.5 to Kea 2.5.7.
271+
// The origin parameter was introduced for this command in Kea 2.5.5 but
272+
// renamed to origin-id to be consistent with the origin-id used in
273+
// dhcp-enable and dhcp-disable commands starting from Kea 2.5.8.
271274
args->set("origin", Element::create(origin_id));
272275
auto command = config::createCommand("ha-sync-complete-notify", args);
273276
insertService(command, server_type);

src/share/api/dhcp-disable.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"access": "write",
33
"avail": "1.4.0",
44
"brief": [
5-
"This command globally disables the DHCP service."
5+
"This command disables the DHCP service."
66
],
77
"cmd-syntax": [
88
"{",
99
" \"command\": \"dhcp-disable\",",
1010
" \"arguments\": {",
1111
" \"max-period\": 20,",
12-
" \"origin\": \"user\"",
12+
" \"origin\": \"ha-partner\",",
13+
" \"origin-id\": 2002",
1314
" }",
1415
"}"
1516
],

src/share/api/dhcp-enable.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"access": "write",
33
"avail": "1.4.0",
44
"brief": [
5-
"This command globally enables the DHCP service."
5+
"This command enables the DHCP service."
66
],
77
"cmd-syntax": [
88
"{",
99
" \"command\": \"dhcp-enable\",",
1010
" \"arguments\": {",
11-
" \"origin\": \"user\"",
11+
" \"origin\": \"ha-partner\",",
12+
" \"origin-id\": 2002",
1213
" }",
1314
"}"
1415
],

0 commit comments

Comments
 (0)