Commit 2a0bda48 authored by Robert Ricci's avatar Robert Ricci
Browse files

Renamed reloads table to scheduled_reloads, to better reflect its

purpose, and avoid confusion with the current_reloads table.
parent 85fc434a
...@@ -51,7 +51,7 @@ if ($sth->numrows < 1) { ...@@ -51,7 +51,7 @@ if ($sth->numrows < 1) {
die("There is no experiment '$eid' in project '$pid'.\n"); die("There is no experiment '$eid' in project '$pid'.\n");
} }
$cmd = "lock tables nodes write, node_types read, reloads read, ". $cmd = "lock tables nodes write, node_types read, scheduled_reloads read, ".
"interfaces write, delays write, reserved write, last_reservation write,". "interfaces write, delays write, reserved write, last_reservation write,".
"next_reserve read"; "next_reserve read";
$sth = $dbh->query($cmd) $sth = $dbh->query($cmd)
...@@ -85,7 +85,7 @@ foreach my $n (@node_names) { ...@@ -85,7 +85,7 @@ foreach my $n (@node_names) {
$dbh->query($cmd); $dbh->query($cmd);
# If the node has a reloads entry, change the reservation and start it # If the node has a reloads entry, change the reservation and start it
$cmd = "select node_id,image_id from reloads where node_id='$n'"; $cmd = "select node_id,image_id from scheduled_reloads where node_id='$n'";
$sth = $dbh->query($cmd) $sth = $dbh->query($cmd)
|| (print "Failed Command:\n$cmd\nError string is:".$dbh->errstr."\n" || (print "Failed Command:\n$cmd\nError string is:".$dbh->errstr."\n"
&& $error++); && $error++);
...@@ -179,7 +179,7 @@ $sth = $dbh->query($cmd) ...@@ -179,7 +179,7 @@ $sth = $dbh->query($cmd)
if ( (@reloads > 0) || (keys %reserves > 0) ) { if ( (@reloads > 0) || (keys %reserves > 0) ) {
print "Locking tables.\n"; print "Locking tables.\n";
$cmd = "lock tables nodes read, node_types read, reloads read, ". $cmd = "lock tables nodes read, node_types read, scheduled_reloads read, ".
"interfaces write, reserved write, next_reserve write"; "interfaces write, reserved write, next_reserve write";
$sth = $dbh->query($cmd) $sth = $dbh->query($cmd)
|| die("Locking error:\n$cmd\nError string is:".$dbh->errstr."\n"); || die("Locking error:\n$cmd\nError string is:".$dbh->errstr."\n");
......
...@@ -143,10 +143,10 @@ while (1) { ...@@ -143,10 +143,10 @@ while (1) {
# EID was when nfree noticed an entry in the table. # EID was when nfree noticed an entry in the table.
# #
$query_result = $query_result =
DBQueryWarn("select image_id from reloads where node_id='$node'"); DBQueryWarn("select image_id from scheduled_reloads where node_id='$node'");
if (! $query_result) { if (! $query_result) {
print "DB Error getting imageid from reloads. Waiting a bit.\n"; print "DB Error getting imageid from scheduled_reloads. Waiting a bit.\n";
next; next;
} }
@row = $query_result->fetchrow_array(); @row = $query_result->fetchrow_array();
......
...@@ -163,7 +163,7 @@ foreach my $node (@nodes) { ...@@ -163,7 +163,7 @@ foreach my $node (@nodes) {
# Put it in the reloads table so TMCD knows to free it. # Put it in the reloads table so TMCD knows to free it.
print STDERR "Scheduling reload of $imageid for $pc:\n"; print STDERR "Scheduling reload of $imageid for $pc:\n";
DBQueryFatal("replace into reloads ". DBQueryFatal("replace into scheduled_reloads ".
"(node_id, image_id) values ('$pc', '$imageid')"); "(node_id, image_id) values ('$pc', '$imageid')");
} }
......
...@@ -429,7 +429,7 @@ doreboot(int sock, struct in_addr ipaddr, char *rdata, int tcp) ...@@ -429,7 +429,7 @@ doreboot(int sock, struct in_addr ipaddr, char *rdata, int tcp)
* See if the node was in the reload state. If so we need to clear it * See if the node was in the reload state. If so we need to clear it
* and its reserved status. * and its reserved status.
*/ */
res = mydb_query("select node_id from reloads where node_id='%s'", res = mydb_query("select node_id from scheduled_reloads where node_id='%s'",
1, nodeid); 1, nodeid);
if (!res) { if (!res) {
syslog(LOG_ERR, "REBOOT: %s: DB Error getting reload!", syslog(LOG_ERR, "REBOOT: %s: DB Error getting reload!",
...@@ -442,7 +442,7 @@ doreboot(int sock, struct in_addr ipaddr, char *rdata, int tcp) ...@@ -442,7 +442,7 @@ doreboot(int sock, struct in_addr ipaddr, char *rdata, int tcp)
} }
mysql_free_result(res); mysql_free_result(res);
if (mydb_update("delete from reloads where node_id='%s'", nodeid)) { if (mydb_update("delete from scheduled_reloads where node_id='%s'", nodeid)) {
syslog(LOG_ERR, "REBOOT: %s: DB Error clearing reload!", syslog(LOG_ERR, "REBOOT: %s: DB Error clearing reload!",
nodeid); nodeid);
return 1; return 1;
......
Supports Markdown
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