IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38361


Ignore:
Timestamp:
Jun 3, 2015, 2:28:35 PM (11 years ago)
Author:
watersc1
Message:

Version with all the known bugs and problems resolved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/stsci_disks/p1_clear.pl

    r38279 r38361  
    7070
    7171my $time = time();
    72 my $logDest = "neb://any/stsci_shuffle/${host}.${volume}/${dir}.${time}";
     72my $logDest = "neb://any/stsci_shuffle/${host}.${volume}/${dir}.log.${time}";
    7373my $ipprc = PS::IPP::Config->new( "GPC1" ) or die "Could not create config object.\n";
    7474$ipprc->redirect_output($logDest) or die "Could not redirect output to logfile ${logDest}\n";
     
    7777my $root = "/data/${host}.${volume}/nebulous/${dir}";
    7878my @subdirectories = <$root/*>;
     79my $md5_fails = 0;
    7980
    8081#print "/data/${host}.${volume}/nebulous/${dir}/*\n";
     
    130131                $vols[$i] = $vols[$i] . ".0";
    131132            }
     133           
     134            # Check that we actually have a key on the host we're checking.
     135            my $local_uris = $neb->find_instances($keys[$i],"~" . $host . "." . $volume);
     136            if ($#{ $local_uris } == -1) {
     137                $vols[$i] = undef();
     138                print "# No registered copy of $keys[$i] on ${host}.${volume}.  Treating as NOVOL\n";
     139#               die "No local copy of $keys[$i] on $host . $volume\n";
     140            }
    132141        }
    133142        elsif ($belongs[$i] == 1) {
     
    161170                system("cp -a $files[$i] ${unknown_dir}/$keys[$i]");
    162171            }
    163             system("sync") == 0 or die "Couldn't sync?";
    164         }
    165     }
     172        }
     173    }
     174    system("sync") == 0 or die "Couldn't sync?";
    166175    $otime = $time;
    167176    $time = time();
     
    174183        if ($belongs[$i] == 0) {
    175184            if (defined($vols[$i])) {
     185                print "$keys[$i] $vols[$i] $host $volume \n";
    176186                my $uris = $neb->find_instances($keys[$i],$vols[$i]);
    177187                @$uris = map {URI->new($_)->file if $_} @$uris;
     
    184194            my $tmpmd5 = local_md5sum($uri);
    185195            if ($tmpmd5 ne $md5sums[$i]) {
    186                 die "Post-replication md5sum does not match! $tmpmd5 != $md5sums[$i]";
     196                if (defined($vols[$i])) {
     197                    print "MD5SUM FAIL: $keys[$i] $vols[$i] $md5sums[$i] found: $tmpmd5 \n";
     198                }
     199                else {
     200                    print "MD5SUM FAIL: $keys[$i] NOVOL_BECAUSE_UNKNOWN $md5sums[$i] found: $tmpmd5 \n";
     201                }
     202                $md5_fails ++;
     203                next;
     204#               die "Post-replication md5sum does not match! $keys[$i]: $vols[$i] $tmpmd5 != $md5sums[$i]";
    187205            }
    188206            # End my best validation thought.       
    189207
    190208            if (defined($vols[$i])) {
     209#               print "HERE: $keys[$i] $host $volume\n";
    191210                $neb->cull($keys[$i],$host . "." . $volume);
    192211            }
     
    200219    $time = time();
    201220    $dtime = $time - $otime;
    202     print "LOG END $subdir $time $dtime\n";
    203     die;
     221    print "LOG END $subdir $time $dtime $md5_fails\n";
     222#    die;
    204223}
    205224
Note: See TracChangeset for help on using the changeset viewer.