Commit da0a1419 authored by Leigh Stoller's avatar Leigh Stoller

Change tbswap modify path so that it does not teardown all of the

vnodes when doing the swapout phase. Only do "failed" vnodes, which is
also questionable, but I am leaving that for now.
parent 72da6e47
......@@ -463,13 +463,15 @@ sub doSwapout($) {
$cleanvlans = 0;
}
TBDebugTimeStamp("snmpit finished");
}
if ($type >= CLEANUP) {
#
# This is a hack. We need a more general os_teardown, but for now
# we just kill off the vnode stuff.
# (don't kill off vnodes when UPDATEing.)
# We're not attempting a retry;
#
if ($type >= RETRY) {
# Stop all of the vnodes.
#
if (! $TESTMODE) {
print "Tearing down virtual nodes.\n";
TBDebugTimeStamp("vnode_setup -k started");
if (system("vnode_setup -d -k $pid $eid")) {
......@@ -478,11 +480,8 @@ sub doSwapout($) {
}
TBDebugTimeStamp("vnode_setup finished");
}
}
if ($type >= CLEANUP) {
#
# We're not attempting a retry;
# remove all nodes from the experiment.
# (nfree will send them to RES_FREE_DIRTY)
#
......@@ -507,25 +506,44 @@ sub doSwapout($) {
# incorporated into the experiment (i.e., are RES_READY).
# (nfree will send deallocated nodes to RES_FREE_DIRTY)
#
my @failedpnodes = ();
my @failedvnodes = ();
my @failedNodes = ();
$db_result =
DBQueryFatal("select rv.node_id, n.allocstate ".
"from reserved as rv ".
"left join nodes as n on ".
"n.node_id = rv.node_id ".
my $db_result =
DBQueryFatal("select rv.node_id,n.allocstate,nt.isvirtnode ".
" from reserved as rv ".
"left join nodes as n on n.node_id = rv.node_id ".
"left join node_types as nt on nt.type=n.type ".
"where rv.pid='$pid' and rv.eid='$eid'");
while (my ($node,$allocstate) = $db_result->fetchrow_array) {
while (my ($node,$allocstate,$isvirt) = $db_result->fetchrow_array) {
if ($allocstate ne TBDB_ALLOCSTATE_RES_READY()) {
push(@failedNodes, $node);
if ($isvirt) {
push(@failedvnodes, $node);
}
else {
push(@failedpnodes, $node);
}
}
}
# XXX reboot nodes [e.g., put them in RES_DIRTY()]
# if doing an update -restart.
#
# Tear down failed vnodes. Perhaps not needed?
#
if (!$TESTMODE && @failedvnodes > 0) {
print "Tearing down failed virtual nodes.\n";
TBDebugTimeStamp("vnode_setup -k started");
if (system("vnode_setup -d -k $pid $eid @failedvnodes")) {
print STDERR "*** Failed to tear down vnodes.\n";
$swapout_errors = 1;
}
TBDebugTimeStamp("vnode_setup -k finished");
}
if (@failedNodes > 0) {
#
# Release all failed nodes.
#
if (@failedpnodes > 0 || @failedvnodes > 0) {
print STDERR "Freeing failed nodes.\n";
TBDebugTimeStamp("nfree started");
......@@ -534,7 +552,8 @@ sub doSwapout($) {
# any virtual nodes (owned by this experiment)
# sitting on top of it are freed as well.
#
if (system("nfree -x $pid $eid " . join(" ", @failedNodes))) {
if (system("nfree -x $pid $eid " .
join(" ", (@failedpnodes, @failedvnodes)))) {
print STDERR "*** Could not free nodes.\n";
$swapout_errors = 1;
}
......
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