Skip to content

Commit

Permalink
[#3106] Extended a comment
Browse files Browse the repository at this point in the history
As a result of a review.
  • Loading branch information
msiodelski committed Dec 6, 2023
1 parent 59f5b65 commit 681293f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/hooks/dhcp/high_availability/ha_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down

0 comments on commit 681293f

Please sign in to comment.