Commit 3e949454 authored by Robert Ricci's avatar Robert Ricci
Browse files

If the node should be reloaded, rather than giving it an entry in

last_reservation, and letting the reload daemon pick it up from there,
we schedule a reload and stick it directly into the reloadpending
experiment. The effect of this is that the node never ends up in
the free pool before getting reloaded.

(Note: We _don't_ do this if the node is being freed from the reloading
or reloadpeding experiment)

This change may not be permanent.
parent 019129ad
......@@ -27,10 +27,11 @@ use lib "@prefix@/lib";
use libdb;
use libtestbed;
my $consetup = "$TB/libexec/console_setup";
my $reloadpid = "emulab-ops";
my $pendingeid = "reloadpending";
my $reloadeid = "reloading";
my $consetup = "$TB/libexec/console_setup";
my $sched_reload = "$TB/sbin/sched_reload";
my $reloadpid = "emulab-ops";
my $pendingeid = "reloadpending";
my $reloadeid = "reloading";
my @nodes;
my @freed_nodes=();
......@@ -355,6 +356,21 @@ foreach my $n (@freed_nodes) {
# a reload.
#
if ($mustclean) {
#
# Make sure we don't schedule a reload if the node is coming out of
# the reloading or reloadpending experimenets.
#
if (!(($pid eq $reloadpid) && (($eid eq $reloadeid) ||
($eid eq $pendingeid)))) {
if (system("$sched_reload $n") != 0) {
print STDERR "WARNING: $sched_reload $n failed!\n";
$error++;
}
DBQueryWarn("update reserved set ".
"pid='$reloadpid',eid='$pendingeid' ".
"where node_id='$n'") || $error++;
}
DBQueryWarn("replace into last_reservation values ('$n', '$pid')");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment