Skip to content

Commit

Permalink
fix: save node registry on every upgrade
Browse files Browse the repository at this point in the history
Save the registry when each node is upgraded, whether there was an error or not. Previously, the
registry was only being saved after the entire suite was processed.

Waiting to the end was problematic during the deployment process when Ansible's SSH connection
was lost. It resulted in the registry not being updated and hence no nodes were being reported as
being upgraded. This led me on a bit of a wild goose chase when debugging the connection issues.

It will be very useful to have this fix in for the upgrade process, because nodes should then be
correctly reported as upgraded even if a connection is lost.
  • Loading branch information
jacderida committed Aug 19, 2024
1 parent c2c7f3a commit e4305e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sn_node_manager/src/cmd/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,18 +555,19 @@ pub async fn upgrade(
service_manager.service.service_data.service_name.clone(),
upgrade_result,
));
node_registry.save()?;
}
Err(err) => {
error!("Error upgrading service {service_name}: {err}");
upgrade_summary.push((
node.service_name.clone(),
UpgradeResult::Error(format!("Error: {err}")),
));
node_registry.save()?;
}
}
}

node_registry.save()?;
print_upgrade_summary(upgrade_summary.clone());

if upgrade_summary.iter().any(|(_, r)| {
Expand Down

0 comments on commit e4305e2

Please sign in to comment.