]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[904-add-ability-to-force-a-cb-update-remotely] Addressed comments but still command...
authorFrancis Dupont <fdupont@isc.org>
Fri, 25 Oct 2019 14:50:59 +0000 (16:50 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 28 Oct 2019 09:33:38 +0000 (10:33 +0100)
doc/sphinx/arm/dhcp4-srv.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.h
src/bin/dhcp6/dhcp6_messages.mes

index cb7613271b007360ffc4a0dccab2e66a61b9b60b..f870bebf34e3db8081f24cf90812b0b576fe5285 100644 (file)
@@ -5891,9 +5891,10 @@ server's performance, because the server needs to make at least one query
 to the database to discover the pending configuration updates. The
 default value of the ``config-fetch-wait-time`` is 30 seconds.
 
-To trigger an immediate polling the ``server-update`` command is
-available for both DHCPv4 and DHCPv6 servers since the 1.7.1 Kea
-release.
+The ``server-update`` command can be used to force the server to
+immediately poll the configuration changes from the database and avoid
+waiting for the next fetch cycle. The command was added in 1.7.1 Kea
+release for DHCPv4 and DHCPv6 servers.
 
 Finally, in the configuration example above, two hooks libraries are
 loaded. The first, ``libdhcp_mysql_cb.so``, is the implementation of
index 5c24fe64d8ae413ba20979e05daa9b0dc024b979..3b4af1a3529a12518d7b547bc97c36ad106ffde8 100644 (file)
@@ -565,6 +565,7 @@ ControlledDhcpv4Srv::commandServerUpdateHandler(const std::string&,
         server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
     } catch (const std::exception& ex) {
         LOG_ERROR(dhcp4_logger, DHCP4_CB_FETCH_UPDATES_FAIL)
+            .arg("server-update command")
             .arg(ex.what());
         return (createAnswer(CONTROL_RESULT_ERROR,
                              "Server update failed: " + string(ex.what())));
@@ -1077,6 +1078,7 @@ ControlledDhcpv4Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
 
     } catch (const std::exception& ex) {
         LOG_ERROR(dhcp4_logger, DHCP4_CB_FETCH_UPDATES_FAIL)
+            .arg("periodic poll")
             .arg(ex.what());
 
         // We allow at most 10 consecutive failures after which we stop
index 807b8147da134ab3a4cc56877c7e8546a86cea7a..f08d23b89b504c46755462ad07274df1f1bed25c 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed Jul 10 2019 15:10
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 16:40
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -150,7 +150,7 @@ const char* values[] = {
     "DHCP4_BUFFER_RECEIVE_FAIL", "error on attempt to receive packet: %1",
     "DHCP4_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
     "DHCP4_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet, next waiting signal is %1",
-    "DHCP4_CB_FETCH_UPDATES_FAIL", "error on attempt to fetch configuration updates from the configuration backend(s): %1",
+    "DHCP4_CB_FETCH_UPDATES_FAIL", "error on attempt to fetch configuration updates from the configuration backend(s) for %1: %2",
     "DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
     "DHCP4_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
     "DHCP4_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
index f58ca25bbe951cda870d194037855ed075dce38f..f08447d69bc8f126f88fa05502d1630e3c0186ec 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed Jul 10 2019 15:10
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 16:40
 
 #ifndef DHCP4_MESSAGES_H
 #define DHCP4_MESSAGES_H
index 7a0b1c19f2e18dbacf75897438fdacd7d2b5ee1f..e400a0cfbb3c453e80147565e8e4db775c1b5469 100644 (file)
@@ -46,12 +46,14 @@ by the process. The signal will be handled before the server starts
 waiting for next packets. The argument specifies the next signal to
 be handled by the server.
 
-% DHCP4_CB_FETCH_UPDATES_FAIL error on attempt to fetch configuration updates from the configuration backend(s): %1
+% DHCP4_CB_FETCH_UPDATES_FAIL error on attempt to fetch configuration updates from the configuration backend(s) for %1: %2
 This error message is issued when the server attempted to fetch
 configuration updates from the database and this attempt failed.
-The server will re-try according to the configured value of the
-config-fetch-wait-time parameter. The sole argument contains the
-reason for failure.
+If the error happens during periodic poll, the server will re-try
+according to the configured value of the config-fetch-wait-time
+parameter. The arguments contain the fetch context, i.e. during
+periodic poll or by the server-update command, and the reason for
+failure.
 
 % DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED maximum number of configuration fetch attempts: 10, has been exhausted without success
 This error indicates that the server has made a number of unsuccessful
index c84e71ba6d667ee5444660461059dee641d251fd..9f86128b4857a48aa08551a802f6a3562bd3cbe1 100644 (file)
@@ -565,6 +565,7 @@ ControlledDhcpv6Srv::commandServerUpdateHandler(const std::string&,
         server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
     } catch (const std::exception& ex) {
         LOG_ERROR(dhcp6_logger, DHCP6_CB_FETCH_UPDATES_FAIL)
+            .arg("server-update command")
             .arg(ex.what());
         return (createAnswer(CONTROL_RESULT_ERROR,
                              "Server update failed: " + string(ex.what())));
@@ -1095,6 +1096,7 @@ ControlledDhcpv6Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
 
     } catch (const std::exception& ex) {
         LOG_ERROR(dhcp6_logger, DHCP6_CB_FETCH_UPDATES_FAIL)
+            .arg("periodic poll")
             .arg(ex.what());
 
         // We allow at most 10 consecutive failures after which we stop
index d4e7fc7c72c416c7d1b29219d4628f11215d721c..1c47f130c69431bd0aab44a403ef7c2ea70ae350 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Tue Jul 16 2019 11:03
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 16:41
 
 #include <cstddef>
 #include <log/message_types.h>
index ccb62f0f7ff783eaaf812d332a269b3064c9fed2..c5a99b6e5b446175c93b5cf824205a3ff4e47cf8 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Tue Jul 16 2019 11:03
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 16:41
 
 #ifndef DHCP6_MESSAGES_H
 #define DHCP6_MESSAGES_H
index c980593f617bee4e2c2b942d87b89c9e57a05304..d6e08f49abec31a3f090c65d91c529417cd6247d 100644 (file)
@@ -56,9 +56,11 @@ be handled by the server.
 % DHCP6_CB_FETCH_UPDATES_FAIL error on attempt to fetch configuration updates from the configuration backend(s): %1
 This error message is issued when the server attempted to fetch
 configuration updates from the database and this attempt failed.
-The server will re-try according to the configured value of the
-config-fetch-wait-time parameter. The sole argument contains the
-reason for failure.
+If the error happens during periodic poll, the server will re-try
+according to the configured value of the config-fetch-wait-time
+parameter. The arguments contain the fetch context, i.e. during
+periodic poll or by the server-update command, and the reason for
+failure.
 
 % DHCP6_CB_FETCH_UPDATES_RETRIES_EXHAUSTED maximum number of configuration fetch attempts: 10, has been exhausted without success
 This error indicates that the server has made a number of unsuccessful