🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #65606

Re: Which is faster: retrieve article by article number, or by Msg-ID?

#65606
From: tl
Date: Tue, 03 Jun 2003 22:43
91 lines
5786 bytes
DS  <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t> wrote:
>tl <tl-NOSPAM@nospam.cd.chalmers.se.invalid> wrote in news:HbPCa.1055024
>$YZ.166836@news.easynews.com:
>> DS  <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t> wrote:
>>>archiver@i3w.com (Juergen Helbing) wrote in news:59408.u53201
>>>@archiver.winews.net:
>>>> Tip: Never use 'head' and 'body' commands. Just 'article'.
>>>
>>>Why is this so ? Is 'body' slower to respond than 'article'? If I'm
>>>d/l'g a multi-part of 50 part's, wouldn't it be easier to just fetch
>>>the bodies for decoding and re-assembly, for the client side anyway.
>>>Is there undo strain on the server in this case ?
>> 
>> It wasn't spelled out directly but it's an implication of one of the
>> earlier "commandments" you removed, always validate that you are
>> getting the right article.
>> 
>> The body of the article doesn't contain the information needed to
>> verify that got the right article (Message ID), so it has to use
>> either article or both head AND body commands, and then how do you
>> know that the head and body you get are from the same article! 
>> (Some of the mechanism that could lead to servers doing this could
>> easily lead to this, so it's a valid concern).
>
>I'm not sure if you where speaking of me when you mentioned 
>'"commandments" you removed', but do your thoughts pertain to working 
>with strictly msg ID's rather than individual group message numbers ?
>
>I've been working strictly with message number's and NOT msg ID's due to 
>previously mentioned issue's about some server's not returning the proper 
>message if it is just asked for by msg ID.

It can happen in both cases, and this was explicitly mentioned in the
posting you replied to, which why I formulated me that way.

Yes, it's probably much less likely to hit you when retrieving by
article number, but it CAN happen. It would probably require internal
corruption on the server indexes, but it's been observed in the wild,
so...

Quote from <59408.u53201@archiver.winews.net> by Juergen Helbing
JH> Whenever you are retrieving by msgid then it is necessary to 
JH> validate the incoming message.
JH> This applies also to the retrieval by article number. It is 
JH> ALWAYS necessary to verify whether the incoming article 
JH> is the one you wanted. For this you always need to maintain
JH> the article number together with the msg-id - even if you 
JH> are retrieving by article number.
JH> This is especially funny for crossposts :-)


>Would using the message number's qualify for checking to see if the right 
>message is returned ?

Good question, I like the idea! It would probably catch some but not
all, depends on how you got that article number and how the server
managed to corrupt itself :-)

I'm not convinced that failures are frequent enough to worry about
when retrieving via article number, at least not when not pipelining,
even body might be enough then.
And the same level of "may be good enough" can be reached with
pipelining, using article (not head/body) and verifying the article 
number.

If I was making a binary downloader I would think HARD about NOT
storing/using the message id's directly, using SHA-1 or MD5 hashes
instead, but unless you accept certain restrictions I'd think that you
need to keep either the message id's or hashes of them in memory. If
you are only working on one group at a time you probably won't need it
but then it's clearly inferior to what's already out there!.

However, using hashes should just changes HOW the check is done
(instead of comparing you'd hash the new one and check that it
matches). Doing this would make great sense if one can get away with
it, it would likely be faster (fixed size and good fanout) and
certainly use much less memory (and disk!)...

Assuming that the program can only work with one group at a time you
might not have the message id, in that case I'd probably just ignore
that problem unless it showed up in real life. There IS a way to make
a reasonably secure check, you could always verify the Subject! You
wouldn't have the exact subject (would use to much memory) but you'd
know how it SHOULD look which is good enough :-)

Hmm, someone mentioned NewsBin Pro earlier, they definitely use hashes
for their on-disk format (both message id's and for file "signature"),
I THINK they probably does it for in-memory work too, but I'm not
sure. It's certainly possible to use hashes on-disk without also doing
it in-memory, it's a rather minor complication.
Technical Details
Message-ID: <Lw9Da.326008$vw6.2105292@news.easynews.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!headwall.stanford.edu!newsfeed.news2me.com!newsfeed2.easynews.com!easynews.com!easynews!easynews-local!news.easynews.com.POSTED!not-for-mail
References: <npf9dvsun1hdqbplg77evm6hsmd9nusdrf@4ax.com> <Xns938E5EF3912B2idispcom@24.48.107.54> <HbPCa.1055024$YZ.166836@news.easynews.com> <Xns938EC1436BF5Fidispcom@216.65.98.9>

Show Full Headers
Complete Article Headers
Message-ID: <Lw9Da.326008$vw6.2105292@news.easynews.com>
Subject: Re: Which is faster: retrieve article by article number, or by Msg-ID?
Date: Tue, 03 Jun 2003 22:43:55 GMT
From: tl <tl-NOSPAM@nospam.cd.chalmers.se.invalid>
References: <npf9dvsun1hdqbplg77evm6hsmd9nusdrf@4ax.com> <Xns938E5EF3912B2idispcom@24.48.107.54> <HbPCa.1055024$YZ.166836@news.easynews.com> <Xns938EC1436BF5Fidispcom@216.65.98.9>
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!headwall.stanford.edu!newsfeed.news2me.com!newsfeed2.easynews.com!easynews.com!easynews!easynews-local!news.easynews.com.POSTED!not-for-mail
Newsgroups: news.software.nntp
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Lines: 90
X-Complaints-To: abuse@easynews.com
Organization: EasyNews, UseNet made Easy! - Test our service with our FREE trial at https://www.easynews.com/trial/trial.phtml
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.