Corruption Of Tradspool

Russ Allbery rra at stanford.edu
Sat Sep 21 02:33:33 UTC 2002


David T Ashley <dtashley at esrg.org> writes:

> Due to a power failure, I corrupted my tradspools.  I tried various ways
> of repair mentioned on the web, using makedbz and one other program
> (forgot the name).  Nothing worked.  I still get errors related to INN
> throttled and all that.

Does this help?

URL: <http://www.eyrie.org/~eagle/faqs/inn.html#S4.4>

Subject: 4.4. tradspool: could not open ... File exists

This error generally happens after a crash or unclean shutdown of innd
using the tradspool storage method, and is caused by overview information
being out of sync with what articles are in the spool.  When innd was
restarted, it renumbered its active file (which determines the range of
existing articles in each group and therefore what article number is
assigned to new articles) based on the overview information.  If there are
newer articles already on disk that aren't mentioned in the overview
(because the overview information for those articles hasn't been flushed
to disk yet), new incoming articles will get assigned the same number as
the existing article and then innd will fail to store the article and
throttle with this error.

One way to correct this error is to rebuild the entire overview database
with:

    makehistory -O -x -F

but this takes a long time and is to some degree overkill.  A better
solution in some cases is to just remove all articles in the spool that
have higher numbers than the numbers in the active file.

Here's a Perl script that will do that.  Just save this to a file, make it
executable, and run it, giving it the path to the active file as the first
argument and the path to the top of your tradspool news spool as the
second argument:

    #!/usr/bin/perl
    die "Usage: <name> <active> <spool-path>\n" unless @ARGV == 2;
    open (ACTIVE, $ARGV[0]) or die "Can't open $ARGV[0]: $!\n";
    while (<ACTIVE>) {
        my ($group, $hi, $lo, $flag) = split;
        my $directory = $group;
        next if ($hi == 0 and $lo <= 1);
        $directory =~ tr%.%/%;
        $directory = $ARGV[1] . '/' . $directory;
        opendir (DIR, $directory) or die "Can't open $directory: $!\n";
        while (defined ($_ = readdir DIR)) {
            unlink "$directory/$_" if ($_ > $hi);
        }
        closedir DIR;
    }

INN 2.4 is expected to have better recovery tools to deal with problems
like this, and to be less vulnerable to losing overview information in
system crashes.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list