Commit 089676f5 authored by Mike Hibler's avatar Mike Hibler

Remove dependency on a racy state transition.

The recent reboot-node-if-going-from-PXEWAIT-to-SECURELOAD change to
bootinfo was checking that the node was in PXEKERNEL/PXEBOOTING. However,
the transition from PXEWAKEUP->PXEBOOTING may not have happened yet.

However, the check for PXEBOOTING was unnecessary anyway, since bootinfo
is the one that sends that state and it *always* does it just before calling
query_bootinfo_db (the guy relying on the racy state change). Thus, the node
is intended to be in PXEBOOTING even if that hasn't yet been recorded in
the DB. So just remove the state check (we still check the op_mode).

Note that this only affects nodes that are using the secure diskload MFS.
parent a0d750ac
...@@ -429,8 +429,7 @@ query_bootinfo_db(struct in_addr ipaddr, char *node_id, int version, ...@@ -429,8 +429,7 @@ query_bootinfo_db(struct in_addr ipaddr, char *node_id, int version,
row2 = mysql_fetch_row(res2); row2 = mysql_fetch_row(res2);
error("Secure booting node %s in %s/%s\n", error("Secure booting node %s in %s/%s\n",
ipstr, row2[0], row2[1]); ipstr, row2[0], row2[1]);
if (strcmp(row2[0], "PXEKERNEL") == 0 && if (strcmp(row2[0], "PXEKERNEL") == 0) {
strcmp(row2[1], "PXEBOOTING") == 0) {
info->type = BIBOOTWHAT_TYPE_REBOOT; info->type = BIBOOTWHAT_TYPE_REBOOT;
error("Forcing reboot of %s\n", ipstr); error("Forcing reboot of %s\n", ipstr);
} }
......
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2000-2010 University of Utah and the Flux Group. * Copyright (c) 2000-2012 University of Utah and the Flux Group.
* All rights reserved. * All rights reserved.
*/ */
...@@ -159,6 +159,11 @@ main(int argc, char **argv) ...@@ -159,6 +159,11 @@ main(int argc, char **argv)
fatal("Could not send bootinfo packet!"); fatal("Could not send bootinfo packet!");
} }
#ifdef EVENTSYS #ifdef EVENTSYS
/*
* Keep the great state machine rolling forward...
* Pretend that the client sent a request before we
* send a reply.
*/
bievent_send(target.sin_addr, (void *) NULL, bievent_send(target.sin_addr, (void *) NULL,
TBDB_NODESTATE_PXEBOOTING); TBDB_NODESTATE_PXEBOOTING);
switch (boot_whatp->type) { switch (boot_whatp->type) {
......
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