🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #38729

Re: Musings upon the concept of creating reliable news services with redundant sets of unreliable servers....

#38729
From: Curt Welch
Date: Fri, 16 Jul 1999 00:00
226 lines
13156 bytes
jgreco@ns.sol.net (Joe Greco) wrote:
> In news.software.nntp article <19990715020107.911$aB@newsreader.com>,
> curt@kcwc.com (Curt Welch) wrote:
> :jgreco@ns.sol.net (Joe Greco) wrote:

> :But your server could never deal with that.  It has no way of knowing
> :which of the articles expired too soon.  So it would end up returning
> :all this xover data for articles which no longer exist on the server.
>
> I guess that doesn't bother me since I have no interest in making spam
> articles available, and filter them at the head.

And if your set-up can't deal (well) with servers that have complex
expire patterns (leaving holes in groups etc.) who cares?  That's the type
of thing you might take advantage of it it worked, but if you didn't have
it, it's not really a problem...

> If it really bothers somebody (like, maybe, me, since I thought about it
> and then decided it wasn't really an issue in my environment), in a
> single administrative realm it certainly _is_ possible to know what
> articles are just about to be expired - modify dexpire to tell you, easy
> - and one could extend dreaderd to have a fast "EXPIRE group:num" command
> available via NNTP.  This still leaves the _possibility_ of windows, but
> if I studied your setup I could probably find some odd cases there too.

Sure, there are windows in mine.  The spool is the one deciding when to
expire articles - and it tells the master after-the-fact.  So there's
a window were the master might try to access an article that "should"
be there but isn't by the time the spool receives the request to read
the article (or reports something false to the user (like the low water
mark for a group).

But because I expire in chunks (instead of constantly like in a cycbuf
design) and because the window is normally very small (on the order of 10
msec), the probability of it beeing "seen" by an NNTP client is very small.

The probabibility of hitting a standard NNTP window (like you do an XOVER
command, and then 10 minutes later try to read one of those articles and
find it's gone - either expired or canceled) is far greater than hitting
one of these errors caused by the window in the design.

Since NNTP is full of these windows - and newsreaders deal with them
all the time, you can have small windows of confusion and not really
make matters any worse for the end-user.

And in your system, as long as you can make your overview expire before
(at least most) of your spools, then it will work fine as well.  But
for it to continue running smoothly the admin will have to check it from
time to time.

> :> Even assuming you had some hypothetical package that allowed the
> :> overview database to know when the articles had been removed from
> :> the spool,
> :
> :It's not hypothetical, it's in production and it works fine.
>
> It _is_ hypothetical in the average user's case.  Even INN didn't do
> this; maybe things are different in INN2.

INN didn't do what?  report overview info correctly?  Sure it did.
It didn't update the overview files, but it didn't need to.  It used
the group directory to figure out what was available and what wasn't.
For group commands it scanned the dir to figure out low water marks,
high water marks, and the article count.  For XOVER commands it read
the overview file, but matched it agains what it had found in the
directory to prevent it from returning overview data for articles
which no longer existed.

You could just delete an article by hand and it still reported everything
correctly.

INN 2 broke all that however.  XOVER data from inn2 included info for
articles where had been canceled. XOVER data I think also included data for
articles which had already been overwritten (expired).  As far as I could
tell, the overview data was updated only daily when you ran the overview
expire stuff - and I think the version I was playing with would never
remove xover records for canceled articles.

And if you accepted cancels, that means that many binaries groups had 50%
of their articles canceled (as spam) - and when readers tried to read those
groups, every other article came up as "not available".  Totally
unacceptable.  If you ran good spam filters which took out (at least most
of) the articles before they hit the server, and/or didn't accept cancels,
then this wasn't such a bad problem.  So like your system, if you are
willing to do things the way the system needs them done, it can work ok.
But to me it seemed like a real step down from what we had with INN for
years.  Not to meantion the xover performance issue which was the real
killer for me.

> I'm not saying your scheme is bad,
> but it _is_ rather propietary, therefore it is something you are going to
> end up supporting yourself, which is a scenario I didn't want to find
> myself in.

Yeah, I can understand that. If I was doing this for some ISP, I wouldn't
want to get "stuck" there either (and I would never advise that they get
stuck there either unless they could justify the cost of a full time
developement staff forever).  But since I'm doing this for my own company,
and doing development is what I like doing, it's a whole different issue...

> I also didn't want to need any monolithic "master process" ...   um...
> hey.
>
> Now that's an idea.
>
> I don't really like the idea of doing what I described above on general
> principles because you increase complexity rapidly.  But, I wonder, if
> you were just to do it on the master server, and then have the clients
> use dsyncgroups to adjust the lower bounds, you can keep the low number
> in sync fairly easily...  hmm.......

If your system had a way that it could keep the low water marks close to
correct by itslef, then that would be a big step in the right direction.
That would free the news admin from having to adjust expire parameters by
hand to try to keep them close to what the spools were doing.  And that
just sounds like a bitch to me (not so much setting it up the first time,
but the never ending job of making sure it hasn't drifted out of alignement
over time for some reason).

> :I haven't thought too much yet about which route I would go -- though I
> :was leaning towards letting the one master maintain the group indexes
> :and each reader box would have to check back with it for current group
> :status info.  That would keep everything nicely in sync and really make
> :it look like one large consistant server - but puts that more
> :resonspibilty (and work) on the master.
>
> That introduces a big SPOF, which is what this whole thread was about.  I
> can nuke arbitrary portions of my newsreading architecture and the
> remainder will continue to work as best it can.

Yeah, the ideal was to have no SPOF of like that, and your system gets
you much closer to that.  I like that about your system.

But my master isn't as large as your reader boxes so it's not as large
of a SPOF as I suspect you think it is.

I don't keep XOVER or header data on the master - that's all in the spools.
I have the active file info (which is the same as your master SPOF), a
history file to prevent dups (same as your master SPOF), and a file I call
the "group" file which is the index that maps group:article# into
spool:spool_article_number for every article in every group.  This is the
only thing you have distributed to your readers that I keep on my master.
And on my current server, the "group" file is acutally smaller than the
history file.

The three together, active, group, and history, are less than 2GB of data
for a 10 million article spool.  And that's all that's on the master that
needs to be mirrored.  I don't have any easy way to backup that data while
the system is running, but it would be straight forward to add a dump
function to the server which would create snapshots of those files while
the system was live.  And then I just copy those snapshots to a backup
master on a daily basis to have something ready to go when the master turns
up DOA.  Add a transaction log which is sent to the backup master in
real-time and you have a sytem that would loose almost nothing if the
master vaporized on you.

But, now that I'm thinking about this (and using your system as a model),
all I have to do is set up a header-only-like feed to a backup master and
let it keep it's own copy of those files up to date like your readers do.
You know, that's really not hard at all.  The server already knows how to
do feeds, so adding the conecpt of a header only feed is only one more
config file option for the feed and about 1 if() statement in the feed
code.  Actually, I don't even need a header-only feed, I just need to know
the MID, the Xref data, and the spool#-article# info for each article (so
it really is a special transaction log feed - but very similar in concept
to a header only feed - only smaller and faster). And the back-up master
needs xref-slave mode which I haven't done but which will be no problem to
add (it actually uses the Xref: line internally to know where to "post" the
article already).

And of course this "backup master" is now the same thing as a reader box
like yours.  So with a bit more code (to deal with postings being sent back
to the master and a few issues I see with how I cache xover data), I have
working reader boxes like yours, and any of the reader boxes could become
the "master" in seconds if the master died.  It could even automatically
switch when the master died if you either had a way  for the full feed
going to the master to switch to the backup - or could afford to always
feed a full feed to a reader set up to be the hot-backup for the master -
but it would ignore the feed (just reject all articles) until it needed to
become the master...

Hey, if my transit box (providing the full feed to the master) decided the
master was dead, it could switch the feed to one of the readers.  All the
readers could be set up to "act" as master for any (full - not header only)
articles it was sent, and then forward  the header only feed to all the
other masters and readers.  But only articles which it had assigned group
numbers to would be sent to the other boxes in a header-only feed.  This
way, the masters and the readers all become the same.  There is no master
-- only a collection of master/reader boxes which are all clones of each
other.  You control who is "acting" as master just by who you feed the
articles to.

This would have to be a special transit server that knew the importance of
it's roll in selecting the master.  And the transit server would become a
SPOF, but hey, this SPOF is now only a transit server.  If it fails, you
just stop receiving or sending news for a little while until you replace it
(all the readers keep working fine).  And it has no state that needs to be
saved.  A backup transit box that had the same "full feed" defined but
going nowhere (so it's always had a backlog ready), could act at the
backup.

And I'm thinking maybe you can even do a hot-standby swap automatically
with that transit server.  But doing that correctly sounds very complex
(and maybe impossible.) If you ever end up with two master transit servers
feeding articles to two different master/reader boxes, then the shit really
would be hitting the fan.... (and the walls, and the floor, ...)

I see a few potentials for problems here I need to think through, but the
design is starting to look very interesting....

> Right now, my geographically diverse
> spools ...

> Doing it this other way means that I have to pull all the articles to the
> master - a full feed - from each transit server.  Then I have to push the
> full feeds back out to the spool servers.  So, somewhere in there is an
> extra full feed...

Yes, I see now.  Geographically diverse spools.  Sure, you don't want to
have to push an extra full feed anywhere.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Technical Details
Message-ID: <19990715235250.326$EO@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!not-for-mail
References: <brad-1407991832480001@brad.techos.skynet.be> <19990714184455.693$oy@newsreader.com> <378d4353$0$374@news.execpc.com> <19990715020107.911$aB@newsreader.com> <378dd8fb$0$374@news.execpc.com>

Show Full Headers
Complete Article Headers
Message-ID: <19990715235250.326$EO@newsreader.com>
Subject: Re: Musings upon the concept of creating reliable news services with redundant sets of unreliable servers....
Date: Fri, 16 Jul 1999 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <brad-1407991832480001@brad.techos.skynet.be> <19990714184455.693$oy@newsreader.com> <378d4353$0$374@news.execpc.com> <19990715020107.911$aB@newsreader.com> <378dd8fb$0$374@news.execpc.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!not-for-mail
X-Deja-AN: 501597217
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-User: Curt@NewsReader.Com
Organization: NewsReader.Com
X-Url: http://CurtWelch.Com/
Newsgroups: news.software.nntp