]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3106] Extended a comment
authorMarcin Siodelski <marcin@isc.org>
Wed, 6 Dec 2023 14:48:46 +0000 (15:48 +0100)
committerMarcin Siodelski <marcin@isc.org>
Wed, 6 Dec 2023 15:25:14 +0000 (16:25 +0100)
As a result of a review.

src/hooks/dhcp/high_availability/ha_service.cc

index b6f9b96f70b3100df0b4ac94db13467fc8932a9f..668747f5c3ef414db2fc8d855c1fb84797f347b8 100644 (file)
@@ -3011,13 +3011,18 @@ ConstElementPtr
 HAService::processSyncCompleteNotify(const unsigned int origin) {
     if (getCurrState() == HA_PARTNER_DOWN_ST) {
         sync_complete_notified_ = true;
-        // We're in the partner-down state, so we don't want to enable the
-        // service until we confirm that the partner is really available.
-        // Let's disable the service locally until we confirm.
+        // We're in the partner-down state and the partner notified us
+        // that it has synchronized its database. We can't enable the
+        // service yet, because it may result in some new lease allocations
+        // that the partner would miss (we don't send lease updates in the
+        // partner-down state). We must first send the heartbeat and let
+        // the state machine resolve the situation between the partners.
+        // It may unblock the network service.
         network_state_->disableService(getLocalOrigin());
     }
-    // Release the network state lock for the remote origin because we
-    // now have the service disabled locally.
+    // Release the network state lock for the remote origin because we have
+    // acquired the local network state lock above (partner-down state), or
+    // we don't need the lock (other states).
     network_state_->enableService(origin);
     return (createAnswer(CONTROL_RESULT_SUCCESS,
                          "Server successfully notified about the synchronization completion."));