Skip to content

Commit

Permalink
tsmretriever: On retrieve error, warn on partial files
Browse files Browse the repository at this point in the history
Warn if we find files with size mismatch on retrieve errors.

There are some corner cases where this helps pinpoint the reason for
repeated retries etc. The most common case is duplicate files,
as described in #12
  • Loading branch information
ZNikke committed Dec 29, 2022
1 parent 6aae819 commit cb8a80d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tsmretriever.pl
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,19 @@ ()
printlog "dsmc output: " . join("\n", @out);
}

# Check if we got any files of
# unexpected size. This can happen if
# we run out of disk space, or if there
# are duplicate archived files with
# different file size.
while(my($f, $s) = each(%lfinfo)) {
my $fn = "$indir/$f";
my $fsize = (stat($fn))[7];
if(defined($fsize) && $fsize != $s) {
printlog("Warning: Retrieved file $fn size $fsize but it doesn't match request size $s. If the problem persists, manual investigation and intervention is needed.");
}
}

# sleep to pace ourselves if these are
# persistent reoccurring failures
sleep $conf{sleeptime};
Expand Down

0 comments on commit cb8a80d

Please sign in to comment.