Commit c3bb0f28 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add new -f flag to assign_wrapper, and have tbswap use that flag when

tbswap is doing a swapretry (this happens during a normal swapin, when
a node fails). In this case, we want to fix all the nodes (overriding
user setting) when replacing failed nodes!
parent a44b54db
......@@ -41,15 +41,17 @@ my $NoRecover = 0;
sub usage ()
{
print STDERR "Usage: $0 [-v] [-u | -n] pid eid\n";
print STDERR " -v - enables verbose output\n";
print STDERR " -u - enables update functionality\n";
print STDERR "Usage: $0 [-v] [-u [-f] | -n] pid eid\n";
print STDERR " -v - Enables verbose output\n";
print STDERR " -u - Enables update mode\n";
print STDERR " -f - Fix current resources during update mode\n";
print STDERR " -t - Create the TOP file and then exit\n";
print STDERR " -n - Run assign, but do not reserve/modify resources.\n";
exit(-1);
}
my $optlist = "vutn";
my $optlist = "vutnf";
my $verbose = 0;
my $fixmode = 0;
my $updating = 0;
my $toponly = 0;
my $impotent = 0;
......@@ -125,6 +127,9 @@ if (defined($options{"t"})) {
if (defined($options{"n"})) {
$impotent = 1;
}
if (defined($options{"f"})) {
$fixmode = 1;
}
my $pid = $ARGV[0];
my $eid = $ARGV[1];
my $ptopfile = "$pid-$eid-$$.ptop";
......@@ -1328,7 +1333,8 @@ if ($updating && !$impotent) {
if (physnodeisvirtnode($pnode) ||
physnodereuse($pnode) eq "unused");
DBQueryFatal("update interfaces set IP='',IPaliases=NULL,mask=NULL,rtabid='0',vnode_id=NULL " .
DBQueryFatal("update interfaces set IP='',IPaliases=NULL,mask=NULL,".
" rtabid='0',vnode_id=NULL " .
"where node_id='$pnode' and ".
" role='" . TBDB_IFACEROLE_EXPERIMENT() . "'");
......@@ -3541,6 +3547,12 @@ sub LoadExperiment()
}
}
#
# Command line option from tbswap overrides user.
#
$fix_current_resources = 1
if ($fixmode);
printdb "Not fixing current resources during this swapin\n"
if (! $fix_current_resources);
LoadVirtNodes();
......
......@@ -541,14 +541,17 @@ sub doSwapin($) {
TBDebugTimeStamp("assign_wrapper started");
#
# Pass the -u (update) switch into assign_wrapper,
# So any nodes already in the experiment are
# fixed.
# Pass the -u (update) switch into assign_wrapper, which turns on
# update mode. When doing a retry, must also fix the current nodes
# to avoid stuff jumping around when simply trying to replace a node
# that did not boot.
#
my $exitcode;
my $wrapper = "assign_wrapper";
my $wrapper = "assign_wrapper -u";
$wrapper .= " -f"
if ($type == RETRY);
if (system("$wrapper -u $pid $eid")) {
if (system("$wrapper $pid $eid")) {
#
# save this off so it will get passed back later.
# Note that -1 is an uncontrolled error. No recovery.
......
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