Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Elijah Grubb
emulab-devel
Commits
182e950b
Commit
182e950b
authored
Jun 24, 2002
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hmm, forgot to commit the node_update changes that switch to a client
initiated model for updating remote nodes.
parent
192298fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
3 deletions
+58
-3
tbsetup/node_update.in
tbsetup/node_update.in
+58
-3
No files found.
tbsetup/node_update.in
View file @
182e950b
...
...
@@ -88,6 +88,7 @@ my $logname;
my
%pids
=
();
my
$failed
=
0
;
my
$dbuid
;
my
@remotenodes
=
();
#
# We don't want to run this script unless its the real version.
...
...
@@ -195,6 +196,24 @@ if (! @nodes) {
fatal
("
No Nodes in the experiment
");
}
#
# For widearea nodes, just update flag them in the DB. The nodes will
# notice this and suck the data over when they can.
#
foreach
my
$node
(
@nodes
)
{
if
(
TBIsNodeRemote
(
$node
)
&&
!
TBIsNodeVirtual
(
$node
))
{
print
STDOUT
"
Marking widearea node
$node
for update.
\n
";
#
# No point in incrementing the flag past 2!
#
DBQueryFatal
("
update nodes set update_accounts=update_accounts+1
"
.
"
where node_id='
$node
' and update_accounts<2
");
push
(
@remotenodes
,
$node
);
}
}
#
# We want some overlap, but not too much since we could burn up
# a lot processes on wedged nodes. Issue a small number in parallel,
...
...
@@ -203,6 +222,13 @@ if (! @nodes) {
#
my
$maxpids
=
0
;
foreach
my
$node
(
@nodes
)
{
#
# Remote nodes handled just above.
#
if
(
TBIsNodeRemote
(
$node
)
||
TBIsNodeVirtual
(
$node
))
{
next
;
}
while
(
$maxpids
>=
$maxchildren
)
{
my
$thispid
=
waitpid
(
-
1
,
0
);
my
$thisnode
=
$pids
{
$thispid
};
...
...
@@ -212,7 +238,7 @@ foreach my $node ( @nodes ) {
print
STDERR
"
Update of node
$thisnode
failed!
\n
";
}
else
{
print
STDOUT
"
$thisnode
updated
..
.
\n
";
print
STDOUT
"
$thisnode
updated.
\n
";
}
delete
(
$pids
{
$thispid
});
...
...
@@ -236,7 +262,36 @@ foreach my $thispid ( keys(%pids) ) {
print
STDERR
"
Update of node
$node
failed!
\n
";
}
else
{
print
STDOUT
"
$node
updated ...
\n
";
print
STDOUT
"
$node
updated.
\n
";
}
}
#
# Wait a couple of minutes for remote nodes to do the update. We know
# this cause tmcd decrements the update_accounts flag whenever a node
# picks up new accounts.
#
if
(
@remotenodes
)
{
print
STDOUT
"
Waiting a while for widearea nodes to update ...
\n
";
sleep
(
90
);
my
$foo
=
pop
(
@remotenodes
);
my
$str
=
"
node_id='
$foo
'
";
foreach
my
$node
(
@remotenodes
)
{
$str
.=
"
or node_id='
$node
'
";
}
my
$query_result
=
DBQueryFatal
("
select node_id,update_accounts from nodes
"
.
"
where (
$str
)
");
while
(
my
(
$node
,
$notdone
)
=
$query_result
->
fetchrow_array
)
{
if
(
$notdone
)
{
$failed
++
;
print
STDERR
"
Update of node
$node
has not completed!
\n
";
}
else
{
print
STDOUT
"
$node
updated.
\n
";
}
}
}
...
...
@@ -255,7 +310,7 @@ sub UpdateNode {
my
(
$node
)
=
@_
;
my
(
$syspid
,
$mypid
);
print
STDOUT
"
Updating
$node
..
.
\n
";
print
STDOUT
"
Updating
$node
.
\n
";
#
# We need to know if its a remote or local node, so we know how
...
...
Write
Preview
Markdown
is supported
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