🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #68880

Re: INN 2.3.4 article retrieval inconsistencies

#68880
From: Robert Nichols
Date: Wed, 31 Mar 2004 18:38
85 lines
4414 bytes
In article <c3r3eh$6k8$1@squay.lomarline.freeserve.co.uk>,
pbs  <pnews@lomarline.freeserve.co.uk> wrote:
:I have had a problem with OOPS in a Linux kernel 2.4.24 which
:pulls down an INN 2.3.4 server very suddenly.
:
:When the system comes back up there are often problems which
:indicates corruption in the overview directory so I
:follow these steps as userid news to fix it:
:   su root -c  /etc/init.d/innd stop
:   rm -fr $HOME/overview/*
:   makehistory -O -x -F
:   su root -c "/etc/init.d/innd start"
:   ctlinnd renumber ""
:   makehistory -b -f history.n -I -O
:
:However once the system is up and running there still seem to be problems 
:with some articles accessed through the nntp socket connection. These 
:seem to be some of articles which were downloaded in the 24 hours before 
:the crash. I use suck to aquire the articles from my ISP and post them 
:locally using rpost.

I've seen some similar problems that are apparently due to recent
database updates being held in the system's buffer cache and not flushed
out to disk.  If the system crashes while innd is running, those recent
changes are lost.  What I do now is pause the server momentarily after
processing each incoming batch.  This causes the databases to be closed
and reopened.

  { ctlinnd pause "sync" && ctlinnd go "sync"; sync; } | grep -v '^Ok$'

After running the above command, the blocks on disk should be consistent
with the history file and the various overview '.DAT' files as seen
through the kernel's buffer cache.  One might think that 'sync' alone
would do the job, but apparently changes in the mmap-ed database files
don't get flagged for flushing to disk until the files are closed.

Testing the above is a painful process.  Short of rebooting or writing
software that directly accesses the hardware, I don't know of any way
to read what is really on the disk.  I offer the following script, but
IT ONLY WORKS ONCE.  Until you reboot the system there is no way to be
sure that subsequent invocations of 'debugfs' won't be seeing cached
data that is not consistent with what is actually on the platters.
This script works on my Fedora Core 1 Linux distribution.  I make no
claim that it is portable to other systems.  At a minimum, you'll need
to be sure that SPOOLDIR and DBDIR are correct for your installation.

#!/bin/bash
cat <<EOF >&2
########
# WARNING: Caching by the kernel makes this script inherently
#          unreliable.  Use at your own risk.
########
EOF
SPOOLDIR=/newsspool
DBDIR=/var/lib/news
TDIR=`mktemp -d /var/tmp/dbk.XXXXXX` || exit
trap "rm -rf $TDIR" 0

function setdev () {
    cd "$1"
    set -- `df . | tail -1`
    DEV=$1
    FS=$6
    DIR=`/bin/pwd`
    if [ "$DIR" = "$FS" ]
    then  DDIR=
    else  DDIR=${DIR#$FS/}/
    fi
}

setdev $SPOOLDIR
find overview -name '*.DAT' -printf "dump $DDIR%p $TDIR/%f\\n" >$TDIR/dumpov
debugfs -f $TDIR/dumpov $DEV >/dev/null
setdev $DBDIR
debugfs -R "dump ${DDIR}history $TDIR/history" $DEV

find $SPOOLDIR/overview -name '*.DAT' | while read F
do  cmp "$F" "$TDIR/`basename \"$F\"`" || diff "$F" "$TDIR/`basename \"$F\"`"
done
cmp "$DBDIR/history" "$TDIR/history" || diff "$DBDIR/history" "$TDIR/history"
# End of script

-- 
Bob Nichols         AT interaccess.com I am "rnichols"
Technical Details
Message-ID: <c4ep5s$n8c$1@omega-3a.right.here>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!chiapp19.algx.com!chiapp17.algx.com!allegiance!chiapp18.algx.net.POSTED!53ab2750!not-for-mail
References: <c3r3eh$6k8$1@squay.lomarline.freeserve.co.uk>

Show Full Headers
Complete Article Headers
Message-ID: <c4ep5s$n8c$1@omega-3a.right.here>
Subject: Re: INN 2.3.4 article retrieval inconsistencies
Date: Wed, 31 Mar 2004 18:38:42 GMT
From: Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid>
References: <c3r3eh$6k8$1@squay.lomarline.freeserve.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!chiapp19.algx.com!chiapp17.algx.com!allegiance!chiapp18.algx.net.POSTED!53ab2750!not-for-mail
Newsgroups: news.software.nntp
Organization: chaotic
Lines: 39
X-Guaranteed-Fresh-Until: Mon, Apr 05 2004
NNTP-Posting-Host: 66.2.65.101
X-Complaints-To: abuse@algx.net
X-Trace: chiapp18.algx.net 1080758322 66.2.65.101 (Wed, 31 Mar 2004 12:38:42 CST)
NNTP-Posting-Date: Wed, 31 Mar 2004 12:38:42 CST