IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 13, 2014, 9:50:07 AM (12 years ago)
Author:
bills
Message:

from tag. Recalculate md5sum if the file size doesn't match the reglist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStoreServer/scripts/dsreg

    r35389 r37256  
    395395            # if size was supplied make sure that it matches the actual
    396396            # size
     397            my $current_size = $finfo[7];
    397398            if ($file->{bytes}) {
    398                 my $current_size = $finfo[7];
    399399                if ($file->{bytes} != $current_size) {
    400                     &my_die("size on disk: $current_size does not match supplied"
    401                     . " size: $file->{bytes} for $path", $PS_EXIT_PROG_ERROR);
     400
     401#                   XXX we are getting to many instances where sizes and md5sums change between
     402#                   the time that a job runs and measures the value and when the filesets are registered.
     403#                   So far it looks as though the files are actually ok.
     404#                   For now just remeasure if size changes. Might want to do something more
     405#                   clever and raise an error if the difference is larger than some fraction
     406
     407#                    &my_die("size on disk: $current_size does not match supplied"
     408#                    . " size: $file->{bytes} for $path", $PS_EXIT_PROG_ERROR);
     409
     410                    print STDERR "\nWarning: size on disk for $path: $current_size does not match supplied size: $file->{bytes}.\nUsing current size.\n";
     411                    $file->{bytes} = $current_size;
     412                    $file->{md5sum} = undef;
    402413                }
    403414            } else {
    404                 $file->{bytes}  = $finfo[7];
     415                $file->{bytes}  = $current_size;
    405416            }
    406417            if (!$file->{md5sum}) {
Note: See TracChangeset for help on using the changeset viewer.