🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #68803

Re: New NNTP standard in Working Group Last Call

#68803
From: Curt Welch
Date: Fri, 26 Mar 2004 06:34
255 lines
15876 bytes
"Dr.Ruud" <(rvtol+news(AT)hacktic.nl) Administrator@[127.0.0.1]> wrote:
> Toen ik Curt Welch kietelde, kwam er dit uit:
>
> Thanks for your reply. I am not very familiar with all the
> constraints of feeding and sucking, I am comparing this to
> database-replication.
>
> > You can't have error-free operation and redundancy.
>
> OK.
>
> > [conversion from slave to master] can only work without
> > errors if all servers in the system know who is the current master at
> > the exact same time, but that can't be done.  You have to replace your
> > previous single point of failure (article numbering) with a new one - a
> > master arbitrator. So by creating the master-slave system you have not
> > created an error-free redundant system.
>
> But that time-point can be stretched if the systems have a range of
> numbers to work from. This means that each machine goes solo for a
> while, receiving articles. When there are no more article-numbers
> in stock, or some period of time has passed, the article-numbering
> is synchronized with the master

Well, first off, each group has it's own article number sequence.  There
isn't one global numbering happening, there's 100,000 different sequence
numbers, one for each group.  So if you want to assign a block to one
server, you have to assign a block from each group, which is a lot of data
to to "assign".

But more important, articles must show up externally to the clients in
sequence.  If you assign a block of numbers like 100 to 110, to one server,
and 111 to 120 to a second server, articles will show up such as 100, then
111, then maybe 112, then 101.  You can never have a lower article number
show up after a higher article has already been made visible to the
clients.

The reason for this is because the client is told what the high water mark
is, and is allowed to make the assumption that all articles below that
point are already available on the server.  If any article with a number
below the high water mark returns error when you try to fetch it, then the
client should assume the article has expired, or been canceled, and that it
will never return.

You do have the ability to skip numbers without great harm being done, but
you can't have the articles show up out of sequence, so the idea of assign
different blocks of numbers to independent servers just isn't going to be
workable.

> (which can send some numbers back
> to the machine's article-number-store, because the article was
> already known). This synchronization is logged by all the slaves
> (and processed when possible or necessary). Is that feasible?
>
> Or don't you want for machines to run independent for such a period
> of time, because they can of course fail in that time? Or don't
> you want article-numbers stay unused for a while, meaning that
> article #100 is already promoted to the front-end server, while
> article #1 is allocated but still has no actual article.

Right, if article 100 has been made available to the users/clients, then
you have shut the door on the option of having article 99, or 98, or 1,
show up later.

> > The problem goes back to the issue of communication.  There must be
> > communication between the various distributed components, but
> > communication, as well as the servers/processes, can fail.  A server
> > can not tell the difference between failed communication, and a failed
> > processes.
>
> Can a 'heartbeat' minimize that problem? A process that still sends
> heartbeats, should acknowledge a communication within a few heartbeats,
> or be considered failing.

If the network fails and netither server can talk to the other, then they
both assume the other has died when in fact neither has.  If the network
fails in a way that cuts them off from each other, but not from some of the
other parts of the system that's trying to get article numbers, then
everything gets confused.

> > If the master and slave loose touch with each other, they
> > will both think the other has failed, so the slave will think it needs
> > to start acting as the master, and the master will continue to be a
> > master thinking the slave has died.
>
> Before it becomes a master, the converting slave asks for approvals.

Asks who for approval!  That's the point, there is no single "master" to
ask.  And if there is a single master then that single master becomes the
single poing of falure you have to figure out how to prevent from failing.
SO what do you do then, set up a master master and a slave master?  Do you
see the recursion problem here which has no solution?

The idea is that you have multiple independent boxes receiving articles,
and independently, they need to asign article numbers based on what groups
the articles they recieve are posted to.  At the same time, you need a
master to not only assign article numbers, but guarantee that you have not
duplicated an article (assigned two different numbers to the same article).
But that fact was just being ignored because it's more of the same problem.

So if you have two spool servers, A, and B, and a master article number
assigner M, and the slave S, the spool servers will normally ask M for the
correct number for each article, and every article M deals with, it sends
updates to S to let S stay in sync with M.

If spool server B can't contact M, the assumption is that it's down, so it
contact the slave S.  The slave S can't contact M either, so B and S
together decide the Master is down and S is now the new master.  So S
starts assigning article numbers for B.

But at the same time, it's possible that the master M is still working, and
that the only real problem is a network problem which prevents M from
talking to either S or B.  But what if it can still talk to A, but A,
because of the same network failure, can't talk to S or B.  M and A think
that both the slave, and spool server B have crashed.  This is not a
problem, because you have redundant parts for both, so M continues along
assigning article numbers for spool server A.

You have the distributed network partitioned into two working subsets which
both think (incorrectly) that the other subset has crashed.

Creating a reduant and acurate copy of some information (such as the
current sequence number for each group in the active file) is easy when the
redundant componets are working.  But when there's a failure, the system
must halt if accuracy at all cost is required.  However, what you can
always do is to use a single point of failure which has a very low
probability of failing, and use that to act as the master arbitrator for
the reduntand components.  And as long as that single high reliability
componet is working, everything is redundant, and guaranteed to continue
functioning correctly even in the face of multiple failures.  You could for
example create a single master abitrator which the slaves and servers all
talk to just to find out the state of the network.  Any component which
can't talk to the master controler, should consider itself off-line and
stop all functioning.  The master controler is the one that will decide
which box is assigning article numbers, and if that box dies, and the
function needs to be assigned to another box, it's the master controler
which does all the cordination with all the components to make sure the
switch happens and happens without err.

A system like that can be built where the master controler is the only
single point of failure, and the relieablitly of the system can then become
a function of how reliable that master controler is.  For computer hardware
you can make it very relieable by putting the software in ROM and not
having a disk, and by not having any fans that can fail etc.

Or, if the master "controling" task is simple enough, then the master
controler may just be a few electronic components and no software at all.

Usenet news servers however are not so important that you would take this
stuff very far.  Having a single point of failure for the master article
number server is what every server I know does.   If it fails, the server
stops receiving new articles unilt it's fixed, and that's normally good
enough.  A lot of systems require that single point of failure to receive a
full news feed, some require it to receive only a full header feed, and
others have segmented usenet into sets of groups and use a separate master
article number server for each subset.

> There is a timeframe of a few minutes, since all machines that
> receive articles have a range of article-numbers to use up.
>
> Only a system that gets some minimum number of votes (more than
> half the original number of slaves) can become master. There can
> never be more than one master. If, even after some retries, the
> voting fails, human intervention is called for.

Yeah, stuff like that is done to shape the characteristic of the failure.
If the master and slave segment, you have the risk of them running
independently, which for this application would be bad, for other
applications, it might not be so bad.  So what do you want the system to do
when the handoff to the slave fails?  Run independently, or halt?  A voting
system like you suggest above causes it to fail on the side of halting,
which would probably be a good choice for a Usenet server.  If halting is
worse than having them run independently, then you wouldn't use a voting
system like that.  For example, if you have two water pumps acting as
backups for each other, and a master controler uses presure sensors to tell
if the master is working, and to activate the secondary if the master
fails, what should the controler do if it detects a failure in the master
presure sensor and is unable to determine if only the presure sensor failed
or if the pump failed because it just blew up and took out the presure
sensor at the same time?  If running both pumps is only wastes electricty
where as running no pumps causes the reactor to melt down, then it's better
to let them run independently than to risk no pumps working.  So you design
the system to fail on the side of running both pumps when they are unable
to tell the true status of the other.

> > In my current server, the numbering server acts as a master, and all my
> > front-end servers act as slaves.  However, there is no attempt to
> > auto-promote a slave to a master.  I can however manually convert any
> > front-end server into the master in a few minutes with a simple
> > configuration change.  However, it's quite possible that the old (now
> > dead) master had received some articles which it was not able to tell
> > the front-end server about.  Those articles will be lost.  But since
> > the probability of the master failling is small, the system is "good
> > enough".
>
> I don't see the master as a server that is receiving articles. OK,
> it knows (a lot) about all articles. It might even have a copy of
> important headerlines (or hashes of their values) of all articles.
> Or just of all Message-IDs (and -hashes). But that is another subject.
> Is that the right way to model a master?

There is a huge number of ways to segment a usenet server into a
distributed system.  None is really "correct".  Each architecture has
different performance, cost, complexity, and failure characteristics.

I've used the concept of "master" and "slave" in many different generic
terms in these messages.  But the generic idea is that you have two
components, both able to perform the same function, and you want only one
performing the function at a time.  The slave is there ready to perform the
function if the master is unable to continue.  The problem with using a
master slave system is in transfering the job of the master to the slave
when the master fails.

The simple way to do redundancy, and the way that works for a lot of
usenet, is to design the redundant components so that they run at the same
time and share the work.  If there's a failure, you simply have less
components sharing the work.  To gurantee that the system keeps working and
doesn't loose articles when there is a failure, you can design the failure
modes to error on the side of duplication.  i.e., two components may
sometimes duplicate the work, and copy, or store, the same article.

With the execption of the problem of assigning article numbers, this
duplication error is harmelss in a distributed Usenet system assuming the
error happens at a low enough rate to not over burden the individual
components with work.

In a simple, and typical, distributed, usenet server, the article numbering
is handled by a single transit box which is receiving articles from
multiple redundant sources (either external peers or other internal
peering/filtering boxes), it gurantees uniqueness (only one copy of each
article is allowed), and it assigns the article numbers, and then sends the
numbered articles (with Xref lines documenting the numners) to one or more
other spoolers, and/or reader boxes.  This numbering server might be the
only single point of failure in the system with a high probability of
failure.

If you wanted to, you could try to set up a slave to replace the master
article numbering server and set up a system to make the feeds all switch
over to the slave if the master died.  Making sure the slave would be
correctly syncronized and always correctly take over after a failure would
take a lot of work, and would in the end require you to put your trust in
some component which was still a single point of failure.  YOu would only
do that if you felt the MTBF of the master article numbering server wasn't
good enough for you, and if you felt for sure that the far more complex
master slave system did in fact have a better MTBF than the single system.

But like I said, I don't know of anyone that has set up a master slave
system for article numbering in a Usenet sever with an automatic fall-over
system. (i.e., one that doesn't include a human as part of the system like
mine does).

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20040326013416.086$TX@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!news.glorb.com!border1.nntp.ash.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!38.144.126.100.MISMATCH!feed5.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <871xo3w5c6.fsf@windlord.stanford.edu> <xn0dfommipc6fs004@news.clara.net> <87u10t4qie.fsf@windlord.stanford.edu> <xn0dfq4tk2v2hm000@news.clara.net> <pan.2004.03.17.10.27.18.676702@proxad.net> <20040320013951.871$LX@newsreader.com> <pan.2004.03.22.11.54.11.362592@proxad.net> <20040322174557.634$2g@newsreader.com> <pan.2004.03.25.15.07.50.497679@proxad.net> <20040325112145.464$T5@newsreader.com> <c3vbim.1lg.1@news.isolution.nl> <20040325204703.793$2V@newsreader.com> <c40bp2.1i8.1@news.isolution.nl>

Show Full Headers
Complete Article Headers
Message-ID: <20040326013416.086$TX@newsreader.com>
Subject: Re: New NNTP standard in Working Group Last Call
Date: Fri, 26 Mar 2004 06:34:16 +0000
From: curt@kcwc.com (Curt Welch)
References: <871xo3w5c6.fsf@windlord.stanford.edu> <xn0dfommipc6fs004@news.clara.net> <87u10t4qie.fsf@windlord.stanford.edu> <xn0dfq4tk2v2hm000@news.clara.net> <pan.2004.03.17.10.27.18.676702@proxad.net> <20040320013951.871$LX@newsreader.com> <pan.2004.03.22.11.54.11.362592@proxad.net> <20040322174557.634$2g@newsreader.com> <pan.2004.03.25.15.07.50.497679@proxad.net> <20040325112145.464$T5@newsreader.com> <c3vbim.1lg.1@news.isolution.nl> <20040325204703.793$2V@newsreader.com> <c40bp2.1i8.1@news.isolution.nl>
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!news.glorb.com!border1.nntp.ash.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!38.144.126.100.MISMATCH!feed5.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com Ac/pcHXx4Y/405t5i27ynEAylCqAm6xePw_XO5DCF3.3Yb3jQ
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: 254