🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
12 messages
12 total messages Started by Marcus Moennig Thu, 25 Jan 2001 22:15
Article numbering on NNTP servers
#50147
Author: Marcus Moennig
Date: Thu, 25 Jan 2001 22:15
65 lines
3692 bytes
Hi,

I read the following in RFC2980:

>>
4.3 Article Numbering

RFC 977 does not directly address the rules concerning articles
number.  However, the current practice is simple: article numbers are
monotonically increasing, articles may disappear, and therefore the
high and low water marks returned in a GROUP command should be
treated as maximum minima, and minimum maxima, respectively.
<<

I wonder what the real world consequences are here. Say, I start a 
newserver today plug in my live feed and the first article in a group 
I receive gets the article number one. Correct?

This goes on and on through the lifetime of the server, so is there a 
limit where the numbering starts with one again? I understand that is 
not the case, it will simply go on and on. Just to make sure, is it a 
real world problem that the highest article might get bigger than an 
unsigned 32-bit integer (0..4294967295)?

What might be a real-world problem is a server crash. An offline 
newsreader logged into the server yesterday and saved a list of 
headers to disk. Over night the server crashed, all articles are lost  
and admins start sucking in articles again. Will they restart 
numbering with one? 
The newsreader logs in a day after and requests an article by article 
number that it saved the day before. Of course an article with that 
number is no longer there. 
Or it tries to get the list of new headers by sending over XOver and 
uses a low value saved before, e.g. yesterday the newsreader got all 
headers for articles 1565 to 2500, the next day it will try to 
retrieve article headers for #2500 to the highest articleindex on the 
server for this group, but that is now way below #2500, so nothing 
will be retrieved and new headers are not recognised as new by the 
newsreader.

How should a newsreader deal with these situations?
 
When retrieving article bodies for known headers by article number, 
should it check the returned message has the correct MessageId? 

And when selecting a group should it check everytime that the highest 
article number returned after the GROUP ... command is not smaller 
than it was the last time?

Even this wouldn't solve the problem completely, e.g. if a low volume 
group has article 1 to 10 which is copied to local disk by the 
newsreader, then the server has a disk crash, after a month it has 10 
new (different) articles 1 to 12 and the newsreader connects again 
doesn't even notice that there was a problem. It would get articles 
11 to 12, but ignore the other 10 _new_ articles.   

Any ideas, suggestions, explanation of main stream solutions to these 
problems would be appreciated.

Thanks,
Marcus

    

Re: Article numbering on NNTP servers
#50151
Author: Russ Allbery
Date: Fri, 26 Jan 2001 01:48
50 lines
3206 bytes
Marcus Moennig <minibbjd@gmx.net> writes:

> This goes on and on through the lifetime of the server, so is there a
> limit where the numbering starts with one again?

Yes; it's unlikely to be reached any time soon, even in control.cancel,
however.  But yes, sooner or later there would need to be a flag day that
will confuse all of the clients that were reading that group.

> I understand that is not the case, it will simply go on and on.

No.  Article numbers may not exceed an unsigned 32-bit integer; that's
part of the protocol spec.

> What might be a real-world problem is a server crash. An offline
> newsreader logged into the server yesterday and saved a list of headers
> to disk. Over night the server crashed, all articles are lost and admins
> start sucking in articles again. Will they restart numbering with one?

Usually.

> The newsreader logs in a day after and requests an article by article
> number that it saved the day before. Of course an article with that
> number is no longer there.

The news reader should detect that something weird happened when it sends
a GROUP command and discovers that the list of numbers is way off from
what it expects.  rn varients at this point print an error message and
then discard their "already read" information for that group, which is
probably the best thing to do in that situation.

> When retrieving article bodies for known headers by article number,
> should it check the returned message has the correct MessageId?

No.  This is almost certainly unnecessary; if the article numbering
changes, it will change by a lot, in practice.

> Even this wouldn't solve the problem completely, e.g. if a low volume
> group has article 1 to 10 which is copied to local disk by the
> newsreader, then the server has a disk crash, after a month it has 10
> new (different) articles 1 to 12 and the newsreader connects again
> doesn't even notice that there was a problem. It would get articles 11
> to 12, but ignore the other 10 _new_ articles.

Yup.  I think this is unlikely enough that people pretty much just ignore
the problem.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: Article numbering on NNTP servers
#50158
Author: J.B. Moreno
Date: Fri, 26 Jan 2001 04:37
65 lines
3775 bytes
In article <36916.96891amb@40tude.com>,
   Marcus Moennig <minibbjd@gmx.net> wrote:

> What might be a real-world problem is a server crash. An offline 
> newsreader logged into the server yesterday and saved a list of 
> headers to disk. Over night the server crashed, all articles are lost  
> and admins start sucking in articles again. Will they restart 
> numbering with one? 

Yep.  And that's the right thing to do.

> The newsreader logs in a day after and requests an article by article 
> number that it saved the day before. Of course an article with that 
> number is no longer there. 

Right, but what should happen is the newsreader logs in, issues a group
command, gets a response saying that the high water mark is now less
than the next number expected (saved in the .newsrc file or equivalent)
and resets the group to having read nothing, preferably giving a
warning that it had to do so.

I don't see what the problem is, this is rare but not truly
exceptional, the newsreader should handle it with the minimum of fuss
which is the best it can do.

If your newsreader doesn't handle this gracefully, write the author and
complain (I notice you're using Free Spy, I've never heard of this, is
this something you are writing, or have I simply missed it or are you
just messing with the headers?).

> How should a newsreader deal with these situations?
>  
> When retrieving article bodies for known headers by article number, 
> should it check the returned message has the correct MessageId? 

It shouldn't bother, checking the group command is sufficient.
 
> And when selecting a group should it check everytime that the highest 
> article number returned after the GROUP ... command is not smaller 
> than it was the last time?

Absolutely.

> Even this wouldn't solve the problem completely, e.g. if a low volume 
> group has article 1 to 10 which is copied to local disk by the 
> newsreader, then the server has a disk crash, after a month it has 10 
> new (different) articles 1 to 12 and the newsreader connects again 
> doesn't even notice that there was a problem. It would get articles 
> 11 to 12, but ignore the other 10 _new_ articles.   

That's too rate to bother special casing, a good general purpose
solution is to allow the user to reset the read high point.

A common way of doing that is allowing the user to select the group and
hold down a modifying key (say shift, option, control, caps lock,
something) and then when opening the group, the program then asks for
how many articles to get and then attempts to get the articles starting
at "high-usersnum".  Not only does this take care of allowing the user
to get the old articles (if he notices that he needs to), it's handy
for when he accidentally marks the group read and wants to go back to
the old articles.

-- 
J.B. Moreno
Re: Article numbering on NNTP servers
#50162
Author: Juergen Helbing
Date: Fri, 26 Jan 2001 07:00
80 lines
4031 bytes
"Marcus Moennig" <minibbjd@gmx.net> wrote:

>What might be a real-world problem is a server crash. An offline 
>newsreader logged into the server yesterday and saved a list of 
>headers to disk. Over night the server crashed, all articles are lost  
>and admins start sucking in articles again. Will they restart 
>numbering with one? 

I've written a small news-server myself - based on Win32.
Due to the notorious tendency of Win to crash I did add  
special recovery features: The high-number per group is stored
twice (in the group list - and in a special file) - with crash recovery.

This topic is not too important from an admins view who deals
with millions of articles. But users are very confused when they
are missing five articles in a low volume group.

>How should a newsreader deal with these situations?

Most popular news-readers are ignoring the problem and simply 
wait for a high number which is greater than the last stored one.

Users (who wonder about an empty group) can intervent in
two ways:  They can either "catch up" with the group - this resets all
high counters for one/many/all groups to the actual high value. Then 
at least all new messages are fetched from now one.
The second is to "Reload all headers" (almost limited to 300/1000/nnnn).
Of course a good new-reader show repair its xover->articlenumber list.

>When retrieving article bodies for known headers by article number, 
>should it check the returned message has the correct MessageId? 

I have seen a lot of wierd behavior of a few servers: If you fetch
old articles which has been expired, then you sometimes get a 
wrong article. This is a malfunction of a server - but I think that a 
client should always react "defensively".
So it might be a good idea to ALWAYS check the msgid after downloading
an article.

>And when selecting a group should it check everytime that the highest 
>article number returned after the GROUP ... command is not smaller 
>than it was the last time?

I did implement a warning when a high number is lower than before
- and I tried download the entire xover again automatically whenever
the new high number is lower than the last low-number.

However this caused new problems because some servers
reduce their high number if the highest messages are cancelled.
So the situation happens more often than some believe.

>Any ideas, suggestions, explanation of main stream solutions to these 
>problems would be appreciated.

It seems that most news-reader writers are using the actually modern
theory: "Dont bother the user with error-messages - it just confused them".
I dont subscribe to this - but you can choose the same strategy
(it reduces the amount of coding for exceptional situations ;-)

You have two extreme choices:
1 - Ignore high mark decreases - and offer the user the functions to "catch up"
and "reload all".
2 - Reload entire message list (and repair internal article numbering) in case
of high mark decreases.

(I'm using -2- and issue only a warning if more than xxx headers must be reloaded)


btw.: It took me a lot of time to deal with the "high number problem", too.
But obviously RFC 2980 was written by server programmers who did
not take this too serious. Else there would have been a proposal for
servers/readers for this case.

-- 
CU 

Juergen


Re: Article numbering on NNTP servers
#50168
Author: Marcus Moennig
Date: Fri, 26 Jan 2001 10:33
15 lines
1590 bytes
On 25.01.01 23:37:30, "J.B. Moreno" <planb@newsreaders.com> wrote in 
<250120012337304579%planb@newsreaders.com>:

> If your newsreader doesn't handle this gracefully, write the author and
> complain (I notice you're using Free Spy, I've never heard of this, is
> this something you are writing, or have I simply missed it or are you
> just messing with the headers?).

It's something I am writing, however Free Spy is just the code name 
and an allusion to another popular newsreader. 
 
Thanks for the explanation,
Marcus

Re: Article numbering on NNTP servers
#50170
Author: Marcus Moennig
Date: Fri, 26 Jan 2001 10:33
14 lines
1323 bytes
Thanks for the answer!

On 25.01.01 17:48:43, Russ Allbery <rra@stanford.edu> wrote in 
<ylsnm76q2r.fsf@windlord.stanford.edu>:

> No.  Article numbers may not exceed an unsigned 32-bit integer; that's
> part of the protocol spec.

I didn't actually found this in a RFC. Could you tell me the source?
 
Marcus

Re: Article numbering on NNTP servers
#50172
Author: Russ Allbery
Date: Fri, 26 Jan 2001 12:21
14 lines
1458 bytes
Marcus Moennig <minibbjd@gmx.net> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> No.  Article numbers may not exceed an unsigned 32-bit integer; that's
>> part of the protocol spec.

> I didn't actually found this in a RFC. Could you tell me the source?

Hm.  I thought this was in draft-ietf-nntpext-base-11.txt, but now I don't
see it.  I could have sworn I'd seen it before.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: Article numbering on NNTP servers
#50179
Author: J.B. Moreno
Date: Fri, 26 Jan 2001 17:38
24 lines
1763 bytes
In article <36917.48126amb@40tude.com>,
   Marcus Moennig <minibbjd@gmx.net> wrote:

> "J.B. Moreno" <planb@newsreaders.com> wrote in 
> <250120012337304579%planb@newsreaders.com>:
> 
> > If your newsreader doesn't handle this gracefully, write the author and
> > complain (I notice you're using Free Spy, I've never heard of this, is
> > this something you are writing [...]
> 
> It's something I am writing, however Free Spy is just the code name 
> and an allusion to another popular newsreader. 

OK, in that case I'd like to suggest that you take a look at t GNKSA,
<http://www.newsreaders.com/gnksa/>, and when you're ready to let other
people use it you submit it to newsreaders.com for listing.

> Thanks for the explanation,

You're welcome, glad to help.

-- 
J.B. Moreno
Re: Article numbering on NNTP servers
#50210
Author: Russ Allbery
Date: Sat, 27 Jan 2001 11:02
13 lines
1421 bytes
Juergen Helbing <infstar@infostar.de> writes:

> btw.: It took me a lot of time to deal with the "high number problem",
> too.  But obviously RFC 2980 was written by server programmers who did
> not take this too serious. Else there would have been a proposal for
> servers/readers for this case.

RFC 2980 was a documentation of existing practice, not a proposal for
anything new.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: Article numbering on NNTP servers
#50211
Author: Marcus Moennig
Date: Sat, 27 Jan 2001 14:18
76 lines
4041 bytes
Very nice to hear some comments from a developer on the other side! 

> The high-number per group is stored
> twice (in the group list - and in a special file) - with crash recovery.

Well, a disk crash is still a disk crash.
 
> Most popular news-readers are ignoring the problem and simply 
> wait for a high number which is greater than the last stored one.

I don't want to go that way.
 
> The second is to "Reload all headers" (almost limited to 300/1000/nnnn).
> Of course a good new-reader show repair its xover->articlenumber list.

That sounds better.
 
>>When retrieving article bodies for known headers by article number, 
>>should it check the returned message has the correct MessageId? 
> 
> I have seen a lot of wierd behavior of a few servers: If you fetch
> old articles which has been expired, then you sometimes get a 
> wrong article. This is a malfunction of a server - but I think that a 
> client should always react "defensively".

I wasn't aware of such a problem. I think I will add a check here.
 
> I did implement a warning when a high number is lower than before

You mean you implemenened a warrning in a newsreader or in the server 
app you mentioned?

> - and I tried download the entire xover again automatically whenever
> the new high number is lower than the last low-number.
> 
> However this caused new problems because some servers
> reduce their high number if the highest messages are cancelled.
> So the situation happens more often than some believe.

Wouldn't it be safer to check if the low number is lower than the 
last time? I can't think of a situation when this could happen 
without a server problem. Message cancels wouldn't matter here.  
 
> It seems that most news-reader writers are using the actually modern
> theory: "Dont bother the user with error-messages - it just confused them".
> I dont subscribe to this - but you can choose the same strategy
> (it reduces the amount of coding for exceptional situations ;-)

I rather invest some time here and reduce the amount of answering 
support emails from confused or upset users.
 
> You have two extreme choices:
> 1 - Ignore high mark decreases - and offer the user the functions to "catch up"
> and "reload all".
> 2 - Reload entire message list (and repair internal article numbering) in case
> of high mark decreases.
> 
> (I'm using -2- and issue only a warning if more than xxx headers must be reloaded)

And what if the user decides that this takes too much time? You would 
still have false article numbers in your database. I tend to 
implement a strict version of -2-.

> btw.: It took me a lot of time to deal with the "high number problem", too.
> But obviously RFC 2980 was written by server programmers who did
> not take this too serious. Else there would have been a proposal for
> servers/readers for this case.

Maybe it was just written by people who did not use Windows at all 
and so they thought a server crash would be an uncommon problem...

Marcus


Re: Article numbering on NNTP servers
#50223
Author: Bill Cole
Date: Sun, 28 Jan 2001 17:35
55 lines
3397 bytes
In article <ylsnm76q2r.fsf@windlord.stanford.edu>, Russ Allbery 
<rra@stanford.edu> wrote:

>Marcus Moennig <minibbjd@gmx.net> writes:
>
>> This goes on and on through the lifetime of the server, so is there a
>> limit where the numbering starts with one again?
>
>Yes; it's unlikely to be reached any time soon, even in control.cancel,
>however.  But yes, sooner or later there would need to be a flag day that
>will confuse all of the clients that were reading that group.

I'll buy a beer for the first admin to keep a server going long enough 
to really roll a 32-bit article number. I figure that even if it does 
happen someday, it will be at least 6 years off. 

Far more likely events break down into the following unusual cases, in 
high/low count terms:

1. All groups have greatly lowered high and low markers. (server-wide 
renumber, i.e 'this is not the server it was last night')
2. A single group has a slight (relative) drop in high marker. 

It seems to be that this becomes easy to handle: 

If one group shows a low marker drop, assume that the group rolled the 
counter (it SHOULD be a 32-bit integer, but you can't really count on 
that. It may be that the admin hand-reset the group to stick to 6 
decimal digit.)  Treat the group as completely unread.


If every group (3 out of 3 should be a reasonable approximation of 
'every') shows a drop in the low marker, assume that the whole server 
got renumbered (likely the old server is no longer there and your are 
looking at a new one in fact using the old name.)  Treat every group on 
the server as completely unread. 

If the low marker does not drop but the high marker does, it is possible 
that the last article(s) in the group were cancelled or that they were 
lost in a crash of some sort that resulted in 'pruning' back to some 
consistent checkpoint.( I've seen this happen in one oddball server, so 
maybe others are capable of it...)  A group like this is a tough case, 
because you don't know where the damage ended. Maybe 100 articles were 
lost and 80 more have since arrived, so you see a drop of 20 but in fact 
80 are as yet unseen.  it's hard to handle this programmatically. 
Arguably, the ability of a server to behave like this is a bug and a 
violation of the standard, good sense, reasonable client expectations, 
and all that is good and holy.

-- 
Bill Cole
I work for MAPS, but I do not speak for MAPS
This message is the official opinion of the voices in my head. 
Re: Article numbering on NNTP servers
#50317
Author: Juergen Helbing
Date: Tue, 30 Jan 2001 13:44
67 lines
3277 bytes
"Marcus Moennig" <minibbjd@gmx.net> wrote:

>Very nice to hear some comments from a developer on the other side! 

Most neticens here seem to be developers.  :-)

>> I did implement a warning when a high number is lower than before
>
>You mean you implemenened a warrning in a newsreader or in the server 
>app you mentioned?

My own project is both - mainly a server, but also a reader 
(kind of caching proxy).
The warning appears in the "slurping" part of the server (in a log window).

>Wouldn't it be safer to check if the low number is lower than the 
>last time? I can't think of a situation when this could happen 
>without a server problem. Message cancels wouldn't matter here.  

'Safer' is a relative thing.
If a server has the messages 1-105 available, and crashes then 
the next time the numbers might be 1-5  :-)
The low number is just another number.
Of course you can be nearly sure that the server crashed if the
low number decreases (but this should not be the only indicator).

>I rather invest some time here and reduce the amount of answering 
>support emails from confused or upset users.

Good idea - and a good politics!

>And what if the user decides that this takes too much time? You would 
>still have false article numbers in your database. 

If the user "decides" anything, then he was informed - and he used an 
override. I love overrides and believe in users responsibility.

>> btw.: It took me a lot of time to deal with the "high number problem", too.
>> But obviously RFC 2980 was written by server programmers who did
>> not take this too serious. Else there would have been a proposal for
>> servers/readers for this case.
>
>Maybe it was just written by people who did not use Windows at all 
>and so they thought a server crash would be an uncommon problem...

Well, I forgot the smiley there.
I know they did a really good job.

The importance of completeness has been growing in the last time.
And the amounts of crashes (computers, harddisks, software - even power - LOL)
will also increase. So it is a good idea to discuss the entire topic
here. Most NNTP software is under improvement all the time.
And the server guys (even INN on UNIX) are always open for everything.

Reorganised numbers are caused by servers - the newsreader just has to
find a good way to deal with it. Perhaps a server could store its 'low+high-numbers'
daily - and use higher numbers at the next crash recovery.


Good luck for your reader. I'll see it on the net.

-- 
Juergen



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