Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Cecchet
emulab-devel
Commits
182e950b
Commit
182e950b
authored
22 years ago
by
Leigh B. Stoller
Browse files
Options
Downloads
Patches
Plain Diff
Hmm, forgot to commit the node_update changes that switch to a client
initiated model for updating remote nodes.
parent
192298fe
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tbsetup/node_update.in
+58
-3
58 additions, 3 deletions
tbsetup/node_update.in
with
58 additions
and
3 deletions
tbsetup/node_update.in
+
58
−
3
View file @
182e950b
...
@@ -88,6 +88,7 @@ my $logname;
...
@@ -88,6 +88,7 @@ my $logname;
my
%pids
=
();
my
%pids
=
();
my
$failed
=
0
;
my
$failed
=
0
;
my
$dbuid
;
my
$dbuid
;
my
@remotenodes
=
();
#
#
# We don't want to run this script unless its the real version.
# We don't want to run this script unless its the real version.
...
@@ -195,6 +196,24 @@ if (! @nodes) {
...
@@ -195,6 +196,24 @@ if (! @nodes) {
fatal
("
No Nodes in the experiment
");
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
# 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,
# a lot processes on wedged nodes. Issue a small number in parallel,
...
@@ -203,6 +222,13 @@ if (! @nodes) {
...
@@ -203,6 +222,13 @@ if (! @nodes) {
#
#
my
$maxpids
=
0
;
my
$maxpids
=
0
;
foreach
my
$node
(
@nodes
)
{
foreach
my
$node
(
@nodes
)
{
#
# Remote nodes handled just above.
#
if
(
TBIsNodeRemote
(
$node
)
||
TBIsNodeVirtual
(
$node
))
{
next
;
}
while
(
$maxpids
>=
$maxchildren
)
{
while
(
$maxpids
>=
$maxchildren
)
{
my
$thispid
=
waitpid
(
-
1
,
0
);
my
$thispid
=
waitpid
(
-
1
,
0
);
my
$thisnode
=
$pids
{
$thispid
};
my
$thisnode
=
$pids
{
$thispid
};
...
@@ -212,7 +238,7 @@ foreach my $node ( @nodes ) {
...
@@ -212,7 +238,7 @@ foreach my $node ( @nodes ) {
print
STDERR
"
Update of node
$thisnode
failed!
\n
";
print
STDERR
"
Update of node
$thisnode
failed!
\n
";
}
}
else
{
else
{
print
STDOUT
"
$thisnode
updated
..
.
\n
";
print
STDOUT
"
$thisnode
updated.
\n
";
}
}
delete
(
$pids
{
$thispid
});
delete
(
$pids
{
$thispid
});
...
@@ -236,7 +262,36 @@ foreach my $thispid ( keys(%pids) ) {
...
@@ -236,7 +262,36 @@ foreach my $thispid ( keys(%pids) ) {
print
STDERR
"
Update of node
$node
failed!
\n
";
print
STDERR
"
Update of node
$node
failed!
\n
";
}
}
else
{
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 {
...
@@ -255,7 +310,7 @@ sub UpdateNode {
my
(
$node
)
=
@_
;
my
(
$node
)
=
@_
;
my
(
$syspid
,
$mypid
);
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
# We need to know if its a remote or local node, so we know how
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment