Commit 3eb0ae31 authored by David Johnson's avatar David Johnson

Simulate Reload (i.e., send RELOADDONE so stated clears reloads table).

We need to do this when we're not forcing a switch flash (which we don't
do when we try to optimize away the flash because the current OS is the
same as the one already installed.
parent 7af99c61
......@@ -685,7 +685,24 @@ sub Reload($$)
if (!((defined($self->nodeflag($nodeobject,'force'))
&& $self->nodeflag($nodeobject,'force'))
|| $self->nodeflag($nodeobject,'reconfig'))) {
$self->dprint(0,"Reload($node_id): no reload or reconfig to do, exiting!");
tbinfo "$self Reload($node_id): no reload or reconfig to do, simulating reloaddone instead!\n";
#
# BUT -- we need to simulate it from stated's perspective so that
# the reloads table is cleared.
#
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADSETUP);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADING);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADDONE);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_SHUTDOWN);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_BOOTING);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_ISUP);
return 0;
}
......@@ -706,7 +723,20 @@ sub Reload($$)
if (!defined($self->nodeflag($nodeobject,'force'))
|| !$self->nodeflag($nodeobject,'force')) {
if ($self->nodeflag($nodeobject,'reconfig')) {
$self->dprint(1,"Reload($node_id): jumping straight to Reconfigure");
tbinfo "$self Reload($node_id): jumping straight to Reconfigure after simulating unnecessary reload\n";
#
# BUT -- we need to simulate it from stated's perspective so that
# the reloads table is cleared.
#
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADSETUP);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADING);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADDONE);
sleep(1);
TBSetNodeEventState($node_id,TBDB_NODESTATE_SHUTDOWN);
$rc = $self->Reconfigure($nodeobject);
goto done;
}
......
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