The second argument specifies the role of this server instance in this
configuration.
+% HA_STATE_MACHINE_CONTINUED state machine is un-paused
+This informational message is issued when the HA state machine is un-paused.
+This unlocks the server from the current state. It may transition to any
+other state if it needs to do so, e.g. 'partner-down' if its partner appears
+to be offline. The server may also remain in the current state if the HA
+setup state warrants such behavior.
+
+% HA_STATE_MACHINE_PAUSED state machine paused in state %1
+This informational message is issued when the HA state machine is paused.
+HA state machine may be paused in certain states specified in the HA hooks library
+confuguration. When the state machine is paused, the server remains in the given
+state until it is explicitly unpaused (via ha-continue command). If the state
+machine is paused, the server operates normally but can't transition to any
+other state.
+
% HA_STATE_TRANSITION server transitions from %1 to %2 state, partner state is %3
This informational message is issued when the server transitions to a new
state as a result of some interaction (or lack of thereof) with its partner.
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#include <ha_log.h>
+#include <ha_service_states.h>
#include <ha_state_machine_control.h>
+#include <boost/algorithm/string.hpp>
namespace isc {
namespace ha {
if ((state_config->getPausing() == HAConfig::StateConfig::PAUSE_ALWAYS) ||
((state_config->getPausing() == HAConfig::StateConfig::PAUSE_ONCE) &&
first_visit)) {
+ std::string state_name = stateToString(state);
+ boost::to_upper(state_name);
+ LOG_INFO(ha_logger, HA_STATE_MACHINE_PAUSED)
+ .arg(state_name);
paused_ = true;
}
}
}
+void
+HAStateMachineControl::unpause() {
+ if (amPaused()) {
+ LOG_INFO(ha_logger, HA_STATE_MACHINE_CONTINUED);
+ paused_ = false;
+ }
+}
+
} // end of namespace isc::ha
} // end of namespace isc