}
startModel(HA_WAITING_ST);
+ state_machine_control_.notify(HA_WAITING_ST);
LOG_INFO(ha_logger, HA_SERVICE_STARTED)
.arg(HAConfig::HAModeToString(config->getHAMode()))
if (doOnEntry()) {
query_filter_.serveNoScopes();
adjustNetworkState();
- state_machine_control_.notify(getCurrState());
}
// There is nothing to do in that state. This server simply receives
if (doOnEntry()) {
query_filter_.serveDefaultScopes();
adjustNetworkState();
- state_machine_control_.notify(getCurrState());
}
scheduleHeartbeat();
query_filter_.serveDefaultScopes();
}
adjustNetworkState();
-
- state_machine_control_.notify(getCurrState());
}
scheduleHeartbeat();
if (doOnEntry()) {
query_filter_.serveNoScopes();
adjustNetworkState();
- state_machine_control_.notify(getCurrState());
}
scheduleHeartbeat();
if (doOnEntry()) {
query_filter_.serveNoScopes();
adjustNetworkState();
- state_machine_control_.notify(getCurrState());
}
if (state_machine_control_.amPaused()) {
if (doOnEntry()) {
query_filter_.serveDefaultScopes();
adjustNetworkState();
- state_machine_control_.notify(getCurrState());
// In the terminated state we don't send heartbeat.
communication_state_->stopHeartbeat();
if (doOnEntry()) {
query_filter_.serveNoScopes();
adjustNetworkState();
- state_machine_control_.notify(getCurrState());
}
// Only schedule the heartbeat for non-backup servers.
// Do the actual transition.
transition(state, getNextEvent());
+ state_machine_control_.notify(state);
// Inform the administrator whether or not lease updates are generated.
// Updates are never generated by a backup server so it doesn't make
state_machine->getStateConfig(HA_LOAD_BALANCING_ST)->setPausing("always");
state_machine->getStateConfig(HA_PARTNER_DOWN_ST)->setPausing("always");
state_machine->getStateConfig(HA_READY_ST)->setPausing("always");
+ state_machine->getStateConfig(HA_SYNCING_ST)->setPausing("always");
+ state_machine->getStateConfig(HA_TERMINATED_ST)->setPausing("always");
state_machine->getStateConfig(HA_WAITING_ST)->setPausing("always");
startService(valid_config);
TEST_F(HAServiceStateMachineTest, syncingTransitionsLoadBalancingPause) {
HAConfigPtr valid_config = createValidConfiguration();
- // Pause state machine in syncing state.
- auto state_config = valid_config->getStateMachineConfig()->getStateConfig(HA_SYNCING_ST);
- state_config->setPausing("always");
+ auto state_machine = valid_config->getStateMachineConfig();
+
+ // Pause state machine in various states.
+ state_machine->getStateConfig(HA_LOAD_BALANCING_ST)->setPausing("always");
+ state_machine->getStateConfig(HA_PARTNER_DOWN_ST)->setPausing("always");
+ state_machine->getStateConfig(HA_READY_ST)->setPausing("always");
+ state_machine->getStateConfig(HA_SYNCING_ST)->setPausing("always");
+ state_machine->getStateConfig(HA_TERMINATED_ST)->setPausing("always");
+ state_machine->getStateConfig(HA_WAITING_ST)->setPausing("always");
startService(valid_config);
waitForEvent(HAService::HA_HEARTBEAT_COMPLETE_EVT);