From: Marcin Siodelski Date: Wed, 6 Dec 2023 14:48:46 +0000 (+0100) Subject: [#3106] Extended a comment X-Git-Tag: Kea-2.5.5~103 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=681293f807d7776fa5f7abe95918adb1b2e655d8;p=thirdparty%2Fkea.git [#3106] Extended a comment As a result of a review. --- diff --git a/src/hooks/dhcp/high_availability/ha_service.cc b/src/hooks/dhcp/high_availability/ha_service.cc index b6f9b96f70..668747f5c3 100644 --- a/src/hooks/dhcp/high_availability/ha_service.cc +++ b/src/hooks/dhcp/high_availability/ha_service.cc @@ -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."));