Commit b3574ace authored by Mike Hibler's avatar Mike Hibler
Browse files

Avoid designating a node not running linktest as the lintest master.

Only happens in an obscure case. Since virtual nodes can be fixed to other
topology nodes in the NS file, "virthost" nodes can explicitly appear in the
resulting topology descriptions. However, virthost nodes do not run linktest
so we need to ensure they do not get nominated as "linktest master" for an
experiment.

Rather than fix this on the client-side and create further backward-compat
issues, we resolve this in the server-generated linktest topology map.
By marking such virthost nodes as not supporting linktest, the client side
will automatically weed out those nodes.
parent 74c2e128
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group. # Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use English; use English;
...@@ -394,7 +394,7 @@ foreach my $lan (sort keys(%lans)) { ...@@ -394,7 +394,7 @@ foreach my $lan (sort keys(%lans)) {
my $havepmap = 0; my $havepmap = 0;
$query_result = $query_result =
DBQueryFatal("select v.vname,n.node_id,n.phys_nodeid,n.type,". DBQueryFatal("select v.vname,n.node_id,n.phys_nodeid,n.type,".
" o.osid,o.OS,o.version,o.osfeatures". " o.osid,o.OS,o.version,o.osfeatures,r.erole".
" from virt_nodes as v,reserved as r,nodes as n,os_info as o". " from virt_nodes as v,reserved as r,nodes as n,os_info as o".
" where v.pid=r.pid and v.eid=r.eid and v.vname=r.vname". " where v.pid=r.pid and v.eid=r.eid and v.vname=r.vname".
" and r.node_id=n.node_id and n.def_boot_osid=o.osid and". " and r.node_id=n.node_id and n.def_boot_osid=o.osid and".
...@@ -416,11 +416,28 @@ if ($query_result->numrows) { ...@@ -416,11 +416,28 @@ if ($query_result->numrows) {
# Version 2 added osfeatures field # Version 2 added osfeatures field
# #
print $LTPOUT "V 2\n"; print $LTPOUT "V 2\n";
while (my ($vname,$node,$pnode,$ptype,$osid,$os,$osvers,$osfeatures) = while (my ($vname,$node,$pnode,$ptype,$osid,$os,$osvers,$osfeatures,$role)
$query_result->fetchrow_array) { = $query_result->fetchrow_array) {
$os = "UNKNOWN" if (!$os); $os = "UNKNOWN" if (!$os);
$osvers = "0" if (!$osvers); $osvers = "0" if (!$osvers);
$osfeatures = "UNKNOWN" if (!$osfeatures); $osfeatures = "UNKNOWN" if (!$osfeatures);
#
# Ugh. Nodes with role "virthost" can now be part of the explicit
# topology. Nothing wrong with that except that those nodes will
# not run linktest! To ensure that such a node does not get nominated
# as the coordinator for a linktest run, we remove the "linktest"
# attribute from osfeatures. This will tell the linktest script not
# to consider the node for that honor.
#
# One would think that we should just pass the node's role to linktest
# and let it decide for itself, but that would create another level
# of backward incompatibility.
#
if ($role eq "virthost" && $osfeatures =~ /linktest/) {
$osfeatures = join(',',
grep($_ ne "linktest",
split(',', $osfeatures)));
}
print $LTPOUT print $LTPOUT
"H $vname $node $pnode $ptype $osid $os $osvers $osfeatures\n"; "H $vname $node $pnode $ptype $osid $os $osvers $osfeatures\n";
} }
......
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