Commit 47477e53 authored by Mike Hibler's avatar Mike Hibler

Correctly ignore virtnodes in swapout state saving

("correctly" here meaning "don't go down in flames", not "we should never
save the state of vnodes", that will have to be revisited)
parent 4fe2cec0
......@@ -1717,21 +1717,25 @@ sub ExpNodes($$;$)
# Return a hash of all the nodes in an experiment. The hash maps pnames
# to vnames.
#
# usage: ExpNodeVnames(char *pid, char *eid, [bool islocal])
# usage: ExpNodeVnames(char *pid, char *eid, [bool islocal], [bool isphys])
# returns the hash if a valid pid/eid.
# If the optional flag is set, returns only local nodes.
# If the optional islocal is set, returns only local nodes.
# If the optional isphys is set, returns only physical nodes.
# Returns 0 if an invalid pid/eid or if an error.
#
sub ExpNodeVnames($$;$)
sub ExpNodeVnames($$;$$)
{
my($pid, $eid, $flag) = @_;
my($pid, $eid, $localonly, $physonly) = @_;
my(@row);
my(%nodes);
my $clause = "";
if (defined($flag)) {
if (defined($localonly)) {
$clause = "and nt.isremotenode=0";
}
if (defined($physonly)) {
$clause = "and nt.isvirtnode=0";
}
my $query_result =
DBQueryWarn("select r.node_id,r.vname from reserved as r ".
"left join nodes as n on n.node_id=r.node_id ".
......
......@@ -883,7 +883,7 @@ sub osload_setupswapinfo($$;@)
#
# Weed out otherwise ineligible nodes:
# - from experiments that are not saving disk state
# - non-'node' role machines
# - non-'node' role machines (i.e., delaynodes, virthosts)
# They are removed from nodeinfo entirely so we do not complain about
# them below. This is the only reason we are doing this here rather
# than as part of the above query.
......
......@@ -1692,7 +1692,7 @@ sub doSwapoutAction($$%)
my $statetimeout = (5 * 60);
my %state = ();
my %nodes = ExpNodeVnames($pid, $eid, 1);
my %nodes = ExpNodeVnames($pid, $eid, 1, 1);
my @pnodes = keys(%nodes);
if (@pnodes > 0) {
print STDERR "Performing swapout admin MFS actions.\n";
......@@ -1750,7 +1750,13 @@ sub doSwapoutAction($$%)
@pnodes = @enodes;
}
if (TBAdminMfsRunCmd(\%myargs, \@failed, @pnodes)) {
#
# We may have disqualified all the nodes above, so see if there
# is still anything to do.
#
if (@pnodes == 0) {
print STDERR "No nodes require state saving.\n";
} elsif (TBAdminMfsRunCmd(\%myargs, \@failed, @pnodes)) {
if ($soaction{'isfatal'}) {
tberror
"Failed to run '" . $soaction{'command'} . "' on @failed!";
......
Markdown is supported
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