Article View: news.software.nntp
Article #38714Re: Musings upon the concept of creating reliable news services with redundant sets of unreliable servers....
From: Curt Welch
Date: Thu, 15 Jul 1999 00:00
Date: Thu, 15 Jul 1999 00:00
331 lines
17274 bytes
17274 bytes
jgreco@ns.sol.net (Joe Greco) wrote: > :How do they know > :when an article has expired from a spool server? > > They don't. It is actually an extremely elegant design, because it > allows so much flexibility. Yeah, it is really cool how that works since you can use any server which answers ARTICLE <x@y> commands (and just about every news server does that). I remember Matt's postings when he was first talking about this and how excited he was about how it was all coming together. So the trick to making it work nicely is to adjust the way the overview info is expired so that it goes away before the last copy of the article vanishes. Hmmm. That bothers me, but the decoupling you get by "just not bothering" is really cool too. I'll have to think more about that. How do the readers know which of say 10 boxes to get articles from? Does each reader have a priority list of what to try first? Can you tell the reader something like, "for alt.* try these spools in this order, but for anything else, try these?". So it sounds like your(/Matt's) design is based on very loose coupling between the systems. And you have to custom tune each box on it's own to some extent. My design leans more towards the idea that you are building "one" news server which happens to be distributed over many machines - but they are clearly all configured and managed as if it were "one" system, and not a loosely coupled set of servers. So, the idea of using someone elses server as a backup just isn't part of my current design. > Realistically, there is no good general way to keep the overview and > spools completely sync'ed and yet maintain the ability and flexibility to > keep them on separate machines or even separate administrative realms. The separate administrative realms I think kills it, but the way I do the spools allows them to stay very nicely in sync with the group data. But it really limits what you can do in the sense that my design works and acts like "one" news server, where as your design is really just a collection of indepent servers - and servers that can work fine on their own even while supporting the rest of the distributed system. For example, you could set up a small private inn server (say to run some set of local groups). People could read news from that server as well. But if it also feed it's articles to the master server, and all the readers knew to go there to get those local.* groups), then the "big distributed" system would look and act like it had a feed of those groups when in fact it just used the master server. Yeah, I see there are lots of cool things you can do with that design. And each of your front-end readers can have it's own "view" of the world, just like a view onto a relational DB. So they really act just like a set of independent servers that are sharing resources - and can, if configured that way, just act like one big server. > You can design more complex mechanisms that greatly reduce your > flexibility in what clever things you can do... Yes, that's what I did. I added the new level of article numbering that's done by the spools, and it does greatly reduce the flexibility by comparison to what your system is doing, but ... > but this adds great > quantities of complexity. It doesn't stike me as "great quantities of complexity". It only adds one new concept (the name assigned to the article by the spool), and a couple of new NNTP-like commands for dealing with the spools. (AGET and APUT instead of ARTICLE/TAKETHIS). But more important, it makes it work correctly. Your system (as found in the wild) well very likely return active file low water marks, article counts, and xover data that do not correctly match what's available in your spools. My server on the other hand always returns an accurate low water mark, and accurate xover data, accurate "listgroup" data, etc. And the article count is also _exactly_ correct for all but the largest groups (like my control.cancel which currently has over 1.6 million articles in the group). > What if you have lots of "small" spools, > each of which hold the last week of news, but you choose to have one > "retention" spool in your company that holds the last month of news? It's really no problem. Your server is the one that can't deal with complex sets of articles, mine works fine. I'll explain. Right now my server puts each article into only one spool. So there's no redundancy. But the plan is to create mirrors of the spools. The articles are given a "name" based on what spool it was placed in (i.e. spool 10), and what number the spool assigned that article, say article 445566. It's this name (10-445566) that defines the article in all the indexes and the history file. That name is all you need to retrive the article (like your Message-ID). The advantage of that name is that it becomes real simple to tell if the article has been expired yet or if it's still available. Spool 10 "tells" everyone what it's current range of articles is every time it changes. (e.g., spool 10's is currently holding articles 124456 through 999435). So to see if article 10-445566 has been expired, you just get the current low and high article numbers for spool 10 and see if it's within the range. The master server (which is acting as the reader as well right now) just always "knows" what the ranges are for all the spools - so to check an article to see if it's valid, you just make a quick scan thought that small table. When I add mirrors - they can be of different lengths. There could be mulitple short term mirros which are used to help distribute the load, and one long retention spool mirror for spool 10. As long as article 10-445566 is still in at least one spool, then it's still available. And my system can tell that very quicly and very acurately because of the way the articles get numbered sequentialy as they are stored in a spool. And, for example, I can do things like send all articles which are cross posted to more than 4 groups to a special short term "spam" spool. They will expire from the groups much faster than all the other news - leaving holes in the groups. But even with all these holes, my server can still acurattly tell you how many articles are "really" in the group, and they correctly return xover data leaving those articles out of the list. 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. > 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. > the overview database would still have to be clever enough > to wait for the last instance of the article to vanish from the spool > servers before removing the overview data. There's two types of "overview data". There's the index which maps group/article_num into spool-spool_article_num, and there's the xover data. The indexes are easy to scan and easy to expire. You just need that table of information which shows the low and high article numbers for each spool. The xover data is another story. I generate that on demand and cache it (in the spools as "fake" articles). I use the group indexes (along with the spool range tables) to figure out what's valid and what's not. That way, the xover files don't have to accurately reflect the articles. The cached sets of articles expire at some point based on how you configured your system (i.e. which spools did you tell the system to put the xover cahce articles into). They won't exctly match the articles they are caching info for, but since they are used as the "definition" of what's there and what's not, that's not important. > What about a heterogeneous > environment where one of the spool servers isn't even the same software > package? I Can't ever deal with that. That's just something that's cool about the way you are doing it. > :Is there some regular overview expire process which scans everything on > :a regular basis? Or do the readers just expire their data based on > :their own logic (which might or might not match the back-end servers), > :or what? > > Based on their own logic... which is theoretically based on what the > admin knows about the actual environment. Querying each of potentially > dozens of spool servers to make sure that an article no longer exists > on any of them would be bad for a single reader, and disastrous for a > large number of readers. You could do it, sure, but I don't think you > would _want_ to. Right, that would never work. I had to come up with this new scheme to make it practical for the master process to figure out what had expired and what didn't. > :What I did was to have each spool server number the articles > :sequentially. And then, instead of requesting articles by message-id, > :you get them by their number. The storage scheem the servers use are > :set up to make this simple and fast for them to do. > > Diablo makes it fast and easy for them to request by MID. Different > way to implement the same general thing. However, if you mean that you > are storing them by their group.name:number, then you are pushing extra > work up to your spool server because it is having to maintain those > indexes in some fashion or another. The Diablo spool box just lays the > articles down and writes history entries, and retrieval is equally > simple because the history lookup on the MID gives you the reference > to the actual article, which is then trivial to fetch and send to the > client. It sounds like you have to go through some more complex > data to get to the actual message, although if it was coded very > efficiently, I guess it wouldn't be an issue. No, it's really just as simple. I too just lay the articles down into files (in NNTP wire format BTW with CR LF dot CR LF between them so you can scan the raw article files and acurattly extract all the articles). I assign sequential numbers to them and then build a simple index that tells you where (in byte terms) article X begins. Makes it very fast and simpe to extrat articles. The spool servers don't known anything about "groups" or message-IDs. (though it would be real simple for each of my spool servers to also maintain a history file (a.k.a. message-id index) for it's articles so it could respond to an "ARTICLE <x.y>" request...) > That sounds like more dependence than I'd personally like to see. Yeah, my spools are really tied to my front end boxes. Matt made it work with standard NNTP commands and that's just cool. > Oh, wait, your spool/spool-article# is not the same as group/article#? right. > Ich. I see what you're trying to do, but I don't think I like it too > much. It lacks the simple elegance of Diablo, although it may allow > you a particular form of flexibility in how you choose your retention > policy. Right. It makes it real simple to figure out which articles are still in the spool, but takes away all those fun things you can do. > I just make sure I keep the data on the spool servers longer than the > readers store the overview data. I'll concede that that is tricky and > a bit speculative. And it limits you in the type of games you can play with retention of different types of articles. And somewhat important, if you try to use a server which is doing a tricky expire game (like my >5 x post exmple), then there's just no way for you to deal with it. Users will end up getting lots of "article not there" messages. But as long as you have at least one long retention server that's not playing any of those games, then it makes little differenc what the shorter term servers do -- so that's cool and sounds like it can be very workable (though it does make the job of the admin more complex - they really have to understand all this complexity to get it set up right). > ... I still like SCSI better ... Yeah, me too. > ... when the master hands > the reader a header, it becomes "available for reading". There is a > potential window where it is available on A but not B, but that will > happen to yours too as you scale it, I believe. If the definition of "when it's availble" stays on the master then there's no window. If it's distributed, then you are going to get windows. Having N distributed processors get together and "agree" on something (like _now_ is the time to announce the existance of this article), is one of the clasic problems of distributed computing. I think the answer is that it's imposible to do without creating those windows. 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. > :What do you do about the Xref: line? > This is one odd thing. > When you ask for "ARTICLE <x@y>", Oh, my God... Didn't even think about that problem for you. The only way for an NNTP newsreader to map a Message-ID back to the group/article number is to use the XRef: header. (like when trying to follow a thread back across newsgroup bounds). If you just punt and leave it out then that's something else that's broken about your server (at least in my eyes). No, I take that back, you can use the Newsgroup: line, and then down load all headers from the newsgroup and go searching for a match. So the question becomes, how many current newsreaders need that, and what do they do if they don't get it? I have no idea what the answer to that is, but I suspect most newsreaders will deal with because the Xref header really is optional - and many newsreaders my not even try to use it (i.e. they eithre provide no easy way to follow a thread into the old group, or they know how to use the newsgroups: line to do it when the Xref: header is missing..). > In my particular design, then, no, you don't get an Xref: line. If that > bothers you, you can design it such that the spool servers are fed by the > master and do get Xref: lines, but then you lose the automatic > availability guarantee that we just discussed, and you have to make sure > that your spool servers will have the article. > You could do this by making the master Xref: the articles and feed the > spools, then have the spools provide the header-only feeds to each of the > readers. But, then in my case, you are hauling more data than necessary > around across your network - which is why I decided against doing that. Then don't take out the back-end master. The spools do header feeds to a scond master which removes dups as before (it just doesn't xref any more), and then feed the readers as before. Or for more redundancy at the cost of a bit more traffic, have two back-end masters and every spool feed both of those (with IHAVE/TAKETHIS so the redundancy just ads an extra IHAVE for each article header, not another entire copy). and then every reader gets two feeds (but only two), one from each of the redundant back-end masters. > Either way, I like the "lego effect" Matt has built into the overall > design of the system, you can do lots of neat and cool things. Yeah, it really is cool. The downsides that I see are the fact that you can't deal nicely with complex expire logic on the spools (or at least you must have at least one long-term spool with simple expire logic that's easy to "match" with the expire logic of the readers), and this xref issue which seems possible to get right if it's important enough to justify. Cool stuff. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<19990715020107.911$aB@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-mailReferences:
<brad-1407991832480001@brad.techos.skynet.be> <378cc595$0$374@news.execpc.com> <19990714184455.693$oy@newsreader.com> <378d4353$0$374@news.execpc.com>Show Full Headers
Complete Article Headers
Message-ID: <19990715020107.911$aB@newsreader.com>
Subject: Re: Musings upon the concept of creating reliable news services with redundant sets of unreliable servers....
Date: Thu, 15 Jul 1999 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <brad-1407991832480001@brad.techos.skynet.be> <378cc595$0$374@news.execpc.com> <19990714184455.693$oy@newsreader.com> <378d4353$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: 501226051
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