Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
2a0bda48
Commit
2a0bda48
authored
Sep 18, 2001
by
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
Changes
4
Hide whitespace changes
Inline
Side-by-side
db/nfree.in
View file @
2a0bda48
...
...
@@ -51,7 +51,7 @@ if ($sth->numrows < 1) {
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,
"
.
"
next_reserve read
";
$sth
=
$dbh
->
query
(
$cmd
)
...
...
@@ -85,7 +85,7 @@ foreach my $n (@node_names) {
$dbh
->
query
(
$cmd
);
# 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
)
||
(
print
"
Failed Command:
\n
$cmd
\n
Error string is:
"
.
$dbh
->
errstr
.
"
\n
"
&&
$error
++
);
...
...
@@ -179,7 +179,7 @@ $sth = $dbh->query($cmd)
if
(
(
@reloads
>
0
)
||
(
keys
%reserves
>
0
)
)
{
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
";
$sth
=
$dbh
->
query
(
$cmd
)
||
die
("
Locking error:
\n
$cmd
\n
Error string is:
"
.
$dbh
->
errstr
.
"
\n
");
...
...
tbsetup/reload_daemon.in
View file @
2a0bda48
...
...
@@ -143,10 +143,10 @@ while (1) {
# EID was when nfree noticed an entry in the table.
#
$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
)
{
print
"
DB Error getting imageid from reloads. Waiting a bit.
\n
";
print
"
DB Error getting imageid from
scheduled_
reloads. Waiting a bit.
\n
";
next
;
}
@row
=
$query_result
->
fetchrow_array
();
...
...
tbsetup/sched_reload.in
View file @
2a0bda48
...
...
@@ -163,7 +163,7 @@ foreach my $node (@nodes) {
# Put it in the reloads table so TMCD knows to free it.
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
')
");
}
...
...
tmcd/tmcd.c
View file @
2a0bda48
...
...
@@ -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
* 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
);
if
(
!
res
)
{
syslog
(
LOG_ERR
,
"REBOOT: %s: DB Error getting reload!"
,
...
...
@@ -442,7 +442,7 @@ doreboot(int sock, struct in_addr ipaddr, char *rdata, int tcp)
}
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!"
,
nodeid
);
return
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment