🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
6 messages
6 total messages Started by Erik Hensema Wed, 22 May 2002 21:21
[INN] CNFS buffer pointers wrong after a crash
#58936
Author: Erik Hensema
Date: Wed, 22 May 2002 21:21
23 lines
1930 bytes
Hi,

Today we've had a spontaneous reboot of our server machine. Two things
seemed to be damaged:

- active file -- fixed by ctlinnd renumber
- CNFS pointers

the pointers to the last article in the buffers all fell back to somewhere
near the start of the buffer, see: http://news.nl.linux.org/mrtg/ (note
that we only recently converted to CNFS and that not all buffers have
wrapped yet). Having said that, I don't really feel old articles are being
overwritten ;-) So maybe only cnfsstat is wrong and INN still writes at the
correct position in the buffers.

Is there a way to check the constency of the buffers after a crash and is
there a way to find out at what position INN is _really_ writing?


-- 
Erik Hensema (erik@hensema.net)                             ICQ# 8280101
Quoting-HOWTO: http://www.leerquoten.nl
Re: [INN] CNFS buffer pointers wrong after a crash
#59153
Author: Thomas
Date: Mon, 10 Jun 2002 15:03
21 lines
1751 bytes
Erik Hensema wrote:

> Is there a way to check the constency of the buffers after a crash and is
> there a way to find out at what position INN is _really_ writing?

It seems INN's configure script thinks that linux does not need msync 
when using mmap.

The man page for msync says that it is needed however.

I've had the same problem. I'll see if I can check that #define 
MMAP_NEEDS_MSYNC 1 in config.h solves this matter.

I also think that the related MMAP_MISSES_WRITES only applies to real 
buggy mmap implementations (before Linux 2.0 maybe) and is not needed, 
but perhaps somebody knows.


Thomas

Re: [INN] CNFS buffer pointers wrong after a crash
#59155
Author: Russ Allbery
Date: Mon, 10 Jun 2002 22:16
34 lines
2524 bytes
Thomas <zak@spam.invalid> writes:
> Erik Hensema wrote:

>> Is there a way to check the constency of the buffers after a crash and
>> is there a way to find out at what position INN is _really_ writing?

> It seems INN's configure script thinks that linux does not need msync
> when using mmap.

> The man page for msync says that it is needed however.

No, the CNFS implementation is simply wrong.

The configure script is checking for something very specific, namely
whether one needs to msync in order for data written to an mmap'd region
to be visible to a read(2) of the same file.  There are places in INN that
actually use that information.  But CNFS is using it as a check to see
whether it should ever msync period, and of course you still do have to
msync periodically on *all* systems since the data is not guaranteed
written to disk until you do that or do munmap.  The reason why you don't
need to msync before a read(2) is just due to the unified buffer cache in
most modern operating systems.

CNFS needs to occasionally unconditionally msync.  I fixed this for
tradindexed in the pending rewrite; the same thing should happen for CNFS
(and that code too needs a rewrite; much of it right now is nearly
unmaintainable).

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

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: [INN] CNFS buffer pointers wrong after a crash
#59160
Author: Thomas
Date: Tue, 11 Jun 2002 07:36
30 lines
2506 bytes
Russ Allbery wrote:

> CNFS needs to occasionally unconditionally msync.  I fixed this for
> tradindexed in the pending rewrite; the same thing should happen for CNFS
> (and that code too needs a rewrite; much of it right now is nearly
> unmaintainable).

Would running sync from cron be a somewhat valid solution for this? 
Probably not, as sync cannot know whether a page has been written to. 
Still a sync takes up to 4 minutes on our box.

It seems like linux 2.4.18 really very rarely flushes the cnfs heads to 
disk. Our binary buffers were reset to 1.36 cycles - while having 
reached around 30 cycles after a few weeks of testing. Only a somewhat 
more specialized buffer was not reset - maybe that gets updated so 
infrequently that it does get flushed out some of the time. This being 
on a box with 2GB ram and 250 GB per day of feed.

I had been thinking about changing the msync entry in config.h, but as 
you indicate there are more areas where msync is required I don't think 
that would be sufficient. However overview files are idle some of the 
time and are closed on a regular basis, and the CNFS data has to be 
flushed by virtue of not fitting in RAM.

Will the rewrite you are referring to be in the CURRENT-snapshots?


Thomas

Re: [INN] CNFS buffer pointers wrong after a crash
#59163
Author: Russ Allbery
Date: Tue, 11 Jun 2002 16:30
31 lines
2336 bytes
Thomas <zak@spam.invalid> writes:
> Russ Allbery wrote:

>> CNFS needs to occasionally unconditionally msync.  I fixed this for
>> tradindexed in the pending rewrite; the same thing should happen for
>> CNFS (and that code too needs a rewrite; much of it right now is nearly
>> unmaintainable).

> Would running sync from cron be a somewhat valid solution for this?

Hm.  Yeah, it might.  It depends on whether sync flushes the buffer cache
to disk or not.  If it does, this may very well solve the problem.

> I had been thinking about changing the msync entry in config.h, but as
> you indicate there are more areas where msync is required I don't think
> that would be sufficient.

I think changing msync in config.h is sufficient; I'm just not sure.

> Will the rewrite you are referring to be in the CURRENT-snapshots?

Yup, but it's not enabled by default yet because it's not yet been tested.
I'll try to send out mail about the current status of it to inn-workers
soon.

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

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: [INN] CNFS buffer pointers wrong after a crash
#59164
Author: BOUWSMA Beery
Date: Tue, 11 Jun 2002 20:47
35 lines
2788 bytes
Yee haw!!1!
%s wrote on %.3s, %lld Sep 1993

> >> CNFS needs to occasionally unconditionally msync.  I fixed this for
> >> tradindexed in the pending rewrite; the same thing should happen for
> >> CNFS (and that code too needs a rewrite; much of it right now is nearly
> >> unmaintainable).

> > Would running sync from cron be a somewhat valid solution for this?

> Hm.  Yeah, it might.  It depends on whether sync flushes the buffer cache
> to disk or not.  If it does, this may very well solve the problem.

Somehow, I seem to remember that it might or might not, depending
on OS being abused.  But it also can introduce a new problem --
you'll also be flushing the history database to disk, which can
take a significant amount of time, depending on how well ordered
your random-access database files happen to be...

Note:  My experience is years out of date, and valid for one
particular OS; I vaguely recall reading something about Linux,
and I also seem to remember some work happening in this direction
under FreeBSD, but I never put those things in practice (when one's
machines never crash, one doesn't bother to think about such fluff)


So just ignore me.

Thank You.

Very Much.

Bouwsma BEERY

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads