Commit 2ce0e873 authored by David Johnson's avatar David Johnson
Browse files

Quick hack for the reload_daemon; since it doesn't wait on a per node type

basis, we make it wait (lots) longer for node types with isremotenode=1.
We just don't have fast enough pipes to all of our remote nodes all the
time to blast out a combo image in 20 minutes!
parent fcedc926
......@@ -75,6 +75,8 @@ my $logfile = "$TB/log/reloadlog";
my $debug = 0;
my $retry_time = 20; # in minutes
my $warn_time = $retry_time * 2; # in minutes
my $widearea_multiplier = 2; # widearea nodes get (mult+1)x longer, but
# possibly not quite true cause of mustwipe)
my %retried = ();
my %warned = ();
my %failed = ();
......@@ -145,9 +147,11 @@ while (1) {
# yields waits of 20, 40 and 60 minutes.
#
$query_result =
DBQueryWarn("select node_id,mustwipe from reserved " .
"where pid='$RELOADPID' and eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL $retry_time * (mustwipe + 1) MINUTE)".
DBQueryWarn("select r.node_id,r.mustwipe from reserved as r" .
" left join nodes as n on r.node_id=n.node_id" .
" left join node_types as nt on n.type=nt.type " .
"where r.pid='$RELOADPID' and r.eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL ($retry_time * (r.mustwipe + 1) + (nt.isremotenode * $retry_time * $widearea_multiplier)) MINUTE)".
" > rsrv_time");
if (! $query_result) {
......@@ -203,9 +207,11 @@ while (1) {
# XXX again, we scale by the value of mustwipe.
#
$query_result =
DBQueryWarn("select node_id,mustwipe from reserved " .
"where pid='$RELOADPID' and eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL $warn_time * (mustwipe + 1) MINUTE)".
DBQueryWarn("select r.node_id,r.mustwipe from reserved as r" .
" left join nodes as n on r.node_id=n.node_id" .
" left join node_types as nt on n.type=nt.type " .
"where r.pid='$RELOADPID' and r.eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL ($warn_time * (mustwipe + 1) + (nt.isremotenode * $warn_time * $widearea_multiplier)) MINUTE)".
" > rsrv_time");
if (! $query_result) {
......
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