Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W6NyX-0006M4-Bk for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jan 2014 17:21:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W6NyW-0001de-Rr for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jan 2014 17:21:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W6NyV-0001dW-Cn for pgsql-hackers@postgresql.org; Thu, 23 Jan 2014 17:21:55 +0000 Received: from moutng.kundenserver.de ([212.227.126.186]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W6NyQ-0007EB-E2 for pgsql-hackers@postgresql.org; Thu, 23 Jan 2014 17:21:55 +0000 Received: from anarazel.de (p5DDC4742.dip0.t-ipconnect.de [93.220.71.66]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0Mg2TZ-1VtxGC1aFh-00Na58; Thu, 23 Jan 2014 18:21:41 +0100 Received: by anarazel.de (Postfix, from userid 1000) id B6F22100434; Thu, 23 Jan 2014 18:21:40 +0100 (CET) Date: Thu, 23 Jan 2014 18:21:40 +0100 From: Andres Freund To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: Changeset Extraction v7.0 (was logical changeset generation) Message-ID: <20140123172140.GH7182@awork2.anarazel.de> References: <20140115203901.GF8653@awork2.anarazel.de> <20140116145432.GD4498@alap3.lan> <20140122144846.GH21170@alap3.anarazel.de> <20140122154858.GK21170@alap3.anarazel.de> <20140123120503.GB7182@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:APZRbbTFgnLMG/uTQhhTkTFtMWtm/hns1FmaKx7c7Il OL/hn9E4OAJBhHZtF8SUdVZrr+ki0jua8Mqbgc9lmhbyyru2BL vokOGo+JB3ZO0u9jLVpPSLZUZd97sk8NzsY1vMvhkX9cAQYBqG /HRYpgSyPE7gffc8k4fruV4YnGnoB8FavcRhu5Anxa2P+xup8e 3GE2NzhGkQae+XZa2cHEausC1B1RCIr8DSNstUBP9Tf4j+XeO7 yG3WekACUwmVFz8KDShu3i0yc7AHeNFuNfU6Rdk6sZye8wXXge 9W7yQ7NK9SUtMNDUYFms5dByjPVcAc+b9jbeVjxPbzcsFgm9u6 yGeoFHu4Ok6SxBYp4qei0nX3EApXl5gLyOmk63GB6 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2014-01-23 11:50:57 -0500, Robert Haas wrote: > On Thu, Jan 23, 2014 at 7:05 AM, Andres Freund wrote: > > I don't think shared buffers fsyncs are the apt comparison. It's more > > something like UpdateControlFile(). Which PANICs. > > > > I really don't get why you fight PANICs in general that much. There are > > some nasty PANICs in postgres which can happen in legitimate situations, > > which should be made to fail more gracefully, but this surely isn't one > > of them. We're doing rename(), unlink() and rmdir(). That's it. > > We should concentrate on the ones that legitimately can happen, not the > > ones created by an admin running a chmod -R 000 . ; rm -rf $PGDATA or > > mount -o remount,ro /. We don't increase reliability by a bit adding > > codepaths that will never get tested. > > Sorry, I don't buy it. Lots of people I know have stories that go > like this "$HORRIBLE happened, and PostgreSQL kept on running, and it > didn't even lose my data!", where $HORRIBLE may be variously that the > disk filled up, that disk writes started failing with I/O errors, that > somebody changed the permissions on the data directory inadvertently, > that the entire data directory got removed, and so on. Especially the "not loosing data" imo is because postgres is conservative with continuing in situations it doesn't know anything about. Most prominently the cluster wide restart after a segfault. > I've been > through some of those scenarios myself, and the care and effort that's > been put into failure modes has saved my bacon more than a few times, > too. We *do* increase reliability by worrying about what will happen > even in code paths that very rarely get exercised. A part of thinking about them *is* restricting what happens in those cases by keeping the possible states to worry about to a minimum. Just splapping on an ERROR instead of PANIC can make things much worse. Not releasing space until a restart, without a chance to do anything about it because we failed to properly release the in-memory slot will just make the problem bigger because now the cleanup might take a week (VACUUM FULLing the entire cluster?). > I think it's completely unacceptable for the failure of routine > filesystem operations to result in a PANIC. I grant you that we have > some existing cases where that can happen (like UpdateControlFile), > but that doesn't mean we should add more. Right this very minute > there is massive bellyaching on a nearby thread caused by the fact > that a full disk condition while writing WAL can PANIC the server, > while on this thread at the very same time you're arguing that adding > more ways for a full disk to cause PANICs won't inconvenience anyone. A full disk won't cause any of the problems for the case we're discussing, will it? We're just doing rename(), unlink(), rmdir() here, all should succeed while the FS is full (afair rename() does on all common FSs because inodes are kept separately). > The other thread is right, and your argument here is wrong. We have > been able to - and have taken the time to - fix comparable problems in > other cases, and we should do the same thing here. I don't think the WAL case is comparable at all. ENOSPC is something expected that can happen during normal operation and doesn't include malintended operator and is reasonably easy to test. unlink() or fsync() randomly failing is not. In fact, isn't the consequence out of that thread that we need a significant amount of extra complexity to handle the case? We shouldn't spend that effort for cases that don't deserve it because they are too unlikely in practice. And yes, there's not too many other places PANICing - because most can rely on WAL handling those tricky cases for them... > Second, I have > encountered a few situations where customers had production servers > that repeatedly PANICked due to some bug or other. If I've ever > encountered angrier customers, I can't remember when. A PANIC is no > big deal when it happens on your development box, but when it happens > on a machine with 100 users connected to it, it's a big deal, > especially if a single underlying cause makes it happen over and over > again. Sure. But blindly continuing and then, possibly quite a bit later, loosing data, causing an outage that takes a long while to recover or something isn't any better. > I think we should be devoting our time to figuring how to improve > this, not whether to improve it. If you'd argue that creating a new slot should fail gracefull, ok, I can relatively easily be convinced of that. But trying to handle failures in the midst of deletion in cases that won't happen in reality is just inviting trouble imo. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers