🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #65331

Re: Questions about Article Numbers

#65331
From: Curt Welch
Date: Fri, 16 May 2003 21:36
91 lines
5500 bytes
chris@invalid.com (CHRIS MORSE) wrote:
> On Tue, 13 May 2003 02:57:20 +0000 (UTC), jeff@litech.org (Jeffrey M.
> Vinocur) wrote:
>
> >In article <ylr873zpy8.fsf@windlord.stanford.edu>,
> >Russ Allbery  <rra@stanford.edu> wrote:
> >>Gerry <gbeggs@Canada.com> writes:
> >>
> >>> Do article numbers always increment?
> >>
> >>Yes.
> >>
> >>> Do article numbers ever "roll over" or reset and go back to zero?
> >>
> >>No, not within the protocol.
> >
> >But, beware for this case in which a high watermark is lower than
> >the last time you checked.  It usually means the server has been
> >reset in some fashion, and if you don't check for it, you won't
> >notice that there are new articles because their article numbers
> >are way way below what you're expecting.  (It's a hack, and you
> >can't catch all the cases, but it's better than nothing.)
> >
> >--
> >Jeffrey M. Vinocur
> >jeff@litech.org
>
> I was going to ask pretty much the same question.
> It's quite obvious that article numbers DO get reset.
> I would say that they *have* to, as they probably won't
> go beyond 2^31 or 2^32.

Well, no.  Since it was never a well defined standard, you can't assume
anything about how different servers work.  There are a lot of potential
things that could happen.  If the server stores the article number as a 32
bit signed value, it could start printing out negative numbers.  Or it
could crash and burn.  It could stop allowing new articles to be assigned
to the group.  It could do any combination of strange things.  If it's
stored as a 64 bit number, it could of course produce numbers too large to
fit in a 32 bit integer.  And it of course is possile that someone write an
unlimited precision number package to hold article numbers.  But that's
highly unlikely.

So something odd is very likely to happen when the numbers get too large,
but have you done the math to see how long it will take?  The most active
group these days has about 100,000 articles per day posted to it.  At that
rate, it will take 58 years to hit 2^31.  Of couse, most groups have far
less so they will take a few hundred or a few thousand years to reach 2^31.

This doesn't take into account the fact that article rates are growing
exponentially, so we will actually have a 2^31 problem much sooner than
that, but it's still way off.

> The question, I think, is how do servers implement this?

I have no clue.  I don't even know what my server will do when it hits it
and I wrote it.  I think I was consistent and used unsigned ints everywhere
when dealing with article numbers, but I bet I fucked up somewhere.  But
even so, I have no real clue about what the code will do when the article
numbers wrap to 0.  It won't be pretty however.  If the server doesn't just
crash, I suspect the most likely outcome is that the group will reset and
all the current articles will in effect vanish. I've just never worred
about it.  Other news server authors might well have taken the same
approach.  My approach is that if a group ever does get close to the end,
the admin has to deal with it manually before it reaches the 2^31 or 2^32
point.

> and how can we detect and handle it best?  do we have
> to do a full rescan of the newsgroup or is there some way to compute
> new values for the article numbers we had before?  (Probably not.)

Right, you can't assume anything really.  If the low and high water marks
shift lower, you have to assume that nothing you knew about article numbers
is valid.  You don't for example even know if you are still talking to the
same server.  They might have built a new server and just switched the DNS
entry to point to the new server, so even if the article numbers overlap,
they me be completely different than before.  The best bet is to throw away
everything you knew about article numbers before and start over for the
group.  You can always attempt to be smart about it and check article
numbers first and see if anything matches up.

> In my own software, I check the high-water number and
> if it's less than the last time I checked, I perform a full rescan of
> the newsgroup.

That's propably the best way to do it.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030516173651.990$v8@newsreader.com>
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!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <1fuuz0y.163h6f012dlkvgN%gbeggs@Canada.com> <ylr873zpy8.fsf@windlord.stanford.edu> <b9pmug$jhp$2@puck.litech.org> <3ec53f93.963923658@news.dsl.net>

Show Full Headers
Complete Article Headers
Message-ID: <20030516173651.990$v8@newsreader.com>
Subject: Re: Questions about Article Numbers
Date: Fri, 16 May 2003 21:36:52 +0000
From: curt@kcwc.com (Curt Welch)
References: <1fuuz0y.163h6f012dlkvgN%gbeggs@Canada.com> <ylr873zpy8.fsf@windlord.stanford.edu> <b9pmug$jhp$2@puck.litech.org> <3ec53f93.963923658@news.dsl.net>
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!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com 43_qCOPPxVCBsLN4Ko33D,dlyV0X0ZRqRsY9Z9fM42X,k4if
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 90