Commit 195b1a3e authored by Leigh Stoller's avatar Leigh Stoller

Add a new trigger to handle the case where old and new images are

mixed togther, and port registrations are not made. The one case
currently handled is when the syncserver node goes ISUP, but has not
reported its port. In this case, it must be an old image and so we
place a port registration in for it.
parent a49c39b5
......@@ -809,6 +809,10 @@ sub stateTransition($$) {
checkGenISUP($node);
next;
};
/^CHECKPORTREG$/ && do {
CheckPortRegistration($node);
next;
};
/^$TBRESET$/ && do {
# We successfully booted, so clear some flags
$nodes{$node}{noretry} = 0;
......@@ -1252,6 +1256,40 @@ sub setTimeout( $$$$ ) {
if (0) { print "Done:\n"; qshow(); }
}
sub CheckPortRegistration($) {
my ($node) = @_;
my ($pid, $eid, $vname);
debug("$node: Checking Port Registration for $node\n");
return
if (! NodeidToExp($node, \$pid, \$eid, \$vname));
#
# The point is to see if a node has come up without filling port
# registrations that would affect backwards compatability with older
# images.
#
my $query_result =
DBQueryWarn("select sync_server from experiments ".
"where pid='$pid' and eid='$eid' and ".
" sync_server='$vname'");
if ($query_result && $query_result->num_rows) {
$query_result =
DBQueryWarn("select port from port_registration ".
"where pid='$pid' and eid='$eid' and ".
" node_id='$node' and service='emulab_syncd'");
if ($query_result && !$query_result->num_rows) {
DBQueryWarn("insert into port_registration set ".
" pid='$pid', eid='$eid', ".
" service='emulab_syncd', ".
" node_id='$node', port='16534'");
}
}
}
# Remove a timeout.
sub remTimeout ($)
{
......
......@@ -530,7 +530,7 @@ REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBFAILED','SHUTDOWN'
REPLACE INTO state_triggers VALUES ('*','RELOAD','RELOADDONE','RESET, RELOADDONE');
REPLACE INTO state_triggers VALUES ('*','RELOAD','RELOADDONEV2','RESET, RELOADDONEV2');
REPLACE INTO state_triggers VALUES ('*','ALWAYSUP','SHUTDOWN','ISUP');
REPLACE INTO state_triggers VALUES ('*','*','ISUP','RESET');
REPLACE INTO state_triggers VALUES ('*','*','ISUP','RESET, CHECKPORTREG');
REPLACE INTO state_triggers VALUES ('*','*','PXEBOOTING','PXEBOOT');
REPLACE INTO state_triggers VALUES ('*','*','BOOTING','BOOTING, CHECKGENISUP');
REPLACE INTO state_triggers VALUES ('*','MINIMAL','ISUP','RESET');
......
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