πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #89460

Re: INN odd behavior during expireover?

#89460
From: Russ Allbery
Date: Fri, 24 Jun 2022 19:57
47 lines
3485 bytes
Julien Γ‰LIE <iulius@nom-de-mon-site.com.invalid> writes:

> I've not looked at the complexity but couldn't the expiration of the
> overview of a newsgroup be done in bulks of 100,000 articles for
> instance?  Lock the group, process the first 100,000 overview lines (and
> retain that n lines have been dropped), release the lock, try to acquire
> a new lock and process the 100,000 next lines from line (100,000 - n),
> etc.

The basic problem is that the expire process involves rewriting the data
file, which invalidates all of the offset information stored in the index.
That's why it holds a write lock on the index while expiring.

Multiple passes would potentially require rewriting the data file and
updating the offsets multiple times, which I would worry would cause other
performance issues.  (Back when I was testing this, I think expiration was
mostly I/O bound and writing the data file was the expensive bit.)

I can think of a couple of possible approaches:

* Store articles that arrive in groups being expired but queue the
  overview information and store it later once the lock is released.  This
  would require some complex state tracking in innd that may be tricky to
  get right and not lose data.

* Perform the bulk of the expiration without holding a lock, and then take
  the lock at the end, find only the articles that have come in during
  expiration, and add them to the new data file before replacing the data
  file.  I think this would work and is probably a simpler place to put
  the complexity, but it will require some careful design to make sure
  there are no race conditions and we can find all the articles that came
  in after expiry started.

Deferring the article back to the peer probably won't work since not all
peers honor deferrals and I think the article is already stored before we
try to write overview.

Using a proper database fixes this problem correctly (but obviously at the
risk of introducing other issues).  In an ideal world, it would be nice to
have one overview mechanism that's good enough we could just have everyone
use it.

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <87sfntg7h5.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!apf2.newsdeef.eu!not-for-mail
References: <4353171044.279cb5a2@freebsd-inject1.usenet.blueworldhosting.com> <4575903189.1ff43929@freebsd-inject1.usenet.blueworldhosting.com> <6762127615.be8e4d99@freebsd-inject1.usenet.blueworldhosting.com> <87edzegi5g.fsf@hope.eyrie.org> <9110422123.e5d78522@freebsd-inject1.usenet.blueworldhosting.com> <87a6a2gd38.fsf@hope.eyrie.org> <t95324$kq1k$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <87sfntg7h5.fsf@hope.eyrie.org>
Subject: Re: INN odd behavior during expireover?
Date: Fri, 24 Jun 2022 12:57:26 -0700
From: Russ Allbery <eagle@eyrie.org>
References: <4353171044.279cb5a2@freebsd-inject1.usenet.blueworldhosting.com> <4575903189.1ff43929@freebsd-inject1.usenet.blueworldhosting.com> <6762127615.be8e4d99@freebsd-inject1.usenet.blueworldhosting.com> <87edzegi5g.fsf@hope.eyrie.org> <9110422123.e5d78522@freebsd-inject1.usenet.blueworldhosting.com> <87a6a2gd38.fsf@hope.eyrie.org> <t95324$kq1k$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!apf2.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: hope.eyrie.org; logging-data="11841"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:LotosXgxvxh2qnLHaBs9Hd3P1pM=
Lines: 46