Commit da498bd5 authored by Robert Ricci's avatar Robert Ricci

Moved clearing of current_reloads table from doreset to doreboot, so that

netdisk is handled properly, since it never does a 'tmcc reset'.
parent bf20104a
......@@ -403,6 +403,22 @@ doreboot(int sock, struct in_addr ipaddr, char *rdata, int tcp)
syslog(LOG_INFO, "REBOOT: %s is reporting a reboot", nodeid);
/*
* Clear the current_reloads for this node, in case it just finished
* reloading. This needs to happen regardless of whether or not the
* node is free or in the reloading experiment.
* XXX: Is it better to blindly do the delete (which will be harmless
* if there is no entry for this node) or to check first, which
* might waste time?
*/
syslog(LOG_INFO, "doreload: %s: Clearing current_reloads", nodeid);
if (mydb_update("delete from current_reloads where node_id='%s'",
nodeid)) {
syslog(LOG_ERR, "doreload: %s: DB Error clearing current_reloads!",
nodeid);
return 1;
}
/*
* Need to check the pid/eid to distinguish between a user
* initiated reload, and a admin scheduled reload. We don't want
......@@ -1946,15 +1962,6 @@ doreset(int sock, struct in_addr ipaddr, char *rdata, int tcp)
"next_pxe_boot_path!", nodeid);
return 1;
}
syslog(LOG_INFO, "doreset: %s: Clearing current_reloads",
nodeid);
if (mydb_update("delete from current_reloads "
"where node_id='%s'", nodeid)) {
syslog(LOG_ERR, "doreset: %s: DB Error clearing "
"current_reloads!", nodeid);
return 1;
}
return 0;
}
......
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