Skip to content

Commit

Permalink
Fixed a bug in self-contact detection in the new restart code
Browse files Browse the repository at this point in the history
I messed up the logic for "if the contact node is not equal to this
node" within restart_to_initial_view(). Both IP and port must be equal
for the node to be equal, and negating an AND is tricky.
  • Loading branch information
etremel committed Feb 8, 2024
1 parent 9f9b42a commit 6441d2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/git_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace derecho {
const int MAJOR_VERSION = 2;
const int MINOR_VERSION = 3;
const int PATCH_VERSION = 0;
const int COMMITS_AHEAD_OF_VERSION = 188;
const int COMMITS_AHEAD_OF_VERSION = 190;
const char* VERSION_STRING = "2.3.0";
const char* VERSION_STRING_PLUS_COMMITS = "2.3.0+188";
const char* VERSION_STRING_PLUS_COMMITS = "2.3.0+190";

}
5 changes: 3 additions & 2 deletions src/core/view_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ bool ViewManager::restart_to_initial_view() {

// First, attempt to contact a current member to see if the system really is in total restart
// Try the configured contact node, unless that is equal to this node
if(my_ip != getConfString(Conf::DERECHO_CONTACT_IP) && my_gms_port != getConfUInt16(Conf::DERECHO_CONTACT_PORT)) {
if(!(my_ip == getConfString(Conf::DERECHO_CONTACT_IP) && my_gms_port == getConfUInt16(Conf::DERECHO_CONTACT_PORT))) {
dbg_debug(vm_logger, "Attempting to connect to contact node {}:{} before starting in recovery mode", getConfString(Conf::DERECHO_CONTACT_IP), getConfUInt16(Conf::DERECHO_CONTACT_PORT));
// This timeout might need to be its own config value, but for now, use 1/2 the restart leader's timeout
bool connection_success = try_connect_to_leader(getConfString(Conf::DERECHO_CONTACT_IP),
getConfUInt16(Conf::DERECHO_CONTACT_PORT),
Expand Down Expand Up @@ -213,7 +214,7 @@ bool ViewManager::restart_to_initial_view() {
dbg_debug(vm_logger, "Restart leader failed, moving to leader #{}", restart_state->num_leader_failures);
}
} else if(enable_backup_restart_leaders) {
dbg_warn(vm_logger, "Couldn't connect to restart leader at {}", restart_state->restart_leader_ips[restart_state->num_leader_failures]);
dbg_warn(vm_logger, "Couldn't connect to restart leader at {}:{}", restart_state->restart_leader_ips[restart_state->num_leader_failures], restart_state->restart_leader_ports[restart_state->num_leader_failures]);
restart_state->num_leader_failures++;
//If backup_restart_leaders is disabled, keep num_leader_failures at 0 and just keep retrying
}
Expand Down

0 comments on commit 6441d2f

Please sign in to comment.