Commit abcc783c authored by David Johnson's avatar David Johnson

Make shared vnodes reloadable. This whole thing sucks for modifies

because we (vnode_setup) needs to go out to the nodes and run vnodesetup
to trigger the reload, but os_setup needs to setup the reload.  So for
now, os_setup sets up the reload but does not wait nor reboot the vnode;
vnode_setup does that like normal.  Probably there are going to be timeout
problems, but it's good enough for my needs right now.
parent 1a58a8b2
......@@ -438,6 +438,7 @@ sub osload ($$) {
my $reload_mode;
my $reload_func;
my $reboot_required;
my $wait_required = 1;
if ($class eq "mote") {
$reload_mode = "UISP";
$reload_func = \&SetupReloadUISP;
......@@ -453,6 +454,11 @@ sub osload ($$) {
$reboot_required = !$nodeflags{$node}{'noreboot'};
}
if (defined($nodeflags{$node})
&& defined($nodeflags{$node}{'nowait'})) {
$wait_required = !$nodeflags{$node}{'nowait'};
}
foreach my $i (@imageidxs) {
# This is passed along so that remote node can request the file.
# Make sure the image object has an access key defined.
......@@ -479,6 +485,7 @@ sub osload ($$) {
'imageids' => \@imageids,
'osid' => $defosid,
'reboot' => $reboot_required,
'wait' => $wait_required,
'zerofree' => $zerofree,
'prepare' => $prepare,
'maxwait' => $maxwait,
......@@ -743,7 +750,16 @@ sub WaitTillReloadDone($$$@)
my $count = @nodes;
my @failed = ();
foreach my $node ( @nodes ) { $done{$node} = 0; }
foreach my $node ( @nodes ) {
if ($reload_info->{$node}{'wait'} == 1) {
$done{$node} = 0;
}
else {
$done{$node} = 1;
--$count;
print "osload ($node): not waiting for reload of $node.\n";
}
}
print STDERR "Waiting for @nodes to finish reloading\n".`date` if $debug;
......
......@@ -76,6 +76,7 @@ my $failedgeni = 0;
my $canceled = 0;
my %nodes = ();
my %vnodes = ();
my %sharednodes = ();
my %vnodephosts = ();
my %vnode2pnode = ();
my %pnodevcount = ();
......@@ -224,7 +225,7 @@ if (TBExptPlabInElabPLC($pid, $eid, \$plcnode)) {
# Get the set of nodes, as well as the nodes table information for them.
#
my $db_result =
DBQueryFatal("select n.*,l.pid,r.vname from reserved as r ".
DBQueryFatal("select n.*,l.pid,r.vname,r.sharing_mode from reserved as r ".
"left join nodes as n on n.node_id=r.node_id ".
"left join last_reservation as l on n.node_id=l.node_id ".
"where r.pid='$pid' and r.eid='$eid'");
......@@ -245,6 +246,8 @@ while (my %row = $db_result->fetchhash()) {
my $class = $typeinfo->class();
my $subnode = $typeinfo->issubnode();
my $virtnode = $typeinfo->isvirtnode();
my $sharednode = defined($row{'sharing_mode'})
&& $row{'sharing_mode'} eq 'using_shared_local';
my $isremote = $typeinfo->isremotenode();
my $isgeninode= $typeinfo->isfednode();
my $imageable = $typeinfo->imageable();
......@@ -260,6 +263,7 @@ while (my %row = $db_result->fetchhash()) {
#
if ($virtnode) {
$vnodes{$node} = $virtnode;
$sharednodes{$node} = $sharednode;
}
else {
$nodes{$node} = $node;
......@@ -272,6 +276,7 @@ while (my %row = $db_result->fetchhash()) {
# and so run them through the checks below.
#
$vnodes{$node} = ($jailnode || $plabnode || $isremote);
$sharednodes{$node} = $sharednode;
$plabvnodes{$node} = $plabnode;
if (! $jailnode && ! $plabnode && !$isremote) {
next;
......@@ -760,6 +765,16 @@ if (!$TESTMODE) {
}
}
#
# osload should not wait for shared vnodes. We need vnode_setup
# to boot/reboot them since the underlying pnode won't be booting.
# So for them, osload just sets up the reload and finishes.
#
if (defined($vnodes{$node}) && $sharednodes{$node} == 1) {
$nodeflags{$node}{'noreboot'} = 1;
$nodeflags{$node}{'nowait'} = 1;
}
TBSetNodeAllocState( $node, TBDB_ALLOCSTATE_RES_RELOAD() );
$nodeAllocStates{$node} = TBDB_ALLOCSTATE_RES_RELOAD();
# No point in reboot/reconfig obviously, since node will reboot!
......
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