Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5z6v-0000uP-NU for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jan 2014 14:48:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W5z6v-0006Pk-5c for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jan 2014 14:48:57 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5z6s-0006ND-Ha for pgsql-hackers@postgresql.org; Wed, 22 Jan 2014 14:48:54 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5z6o-0001PD-Gl for pgsql-hackers@postgresql.org; Wed, 22 Jan 2014 14:48:53 +0000 Received: from intern.anarazel.de (p54AF4424.dip0.t-ipconnect.de [84.175.68.36]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 4192B4E8002; Wed, 22 Jan 2014 15:48:47 +0100 (CET) Date: Wed, 22 Jan 2014 15:48:46 +0100 From: Andres Freund To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: Changeset Extraction v7.0 (was logical changeset generation) Message-ID: <20140122144846.GH21170@alap3.anarazel.de> References: <20140115002223.GA17204@awork2.anarazel.de> <20140115203901.GF8653@awork2.anarazel.de> <20140116145432.GD4498@alap3.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) 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-18 08:35:47 -0500, Robert Haas wrote: > > I am not sure I understand that point. We can either update the > > in-memory bit before performing the on-disk operations or > > afterwards. Either way, there's a way to be inconsistent if the disk > > operation fails somewhere inbetween (it might fail but still have > > deleted the file/directory!). The normal way to handle that in other > > places is PANICing when we don't know so we recover from the on-disk > > state. > > I really don't see the problem here? Code doesn't get more robust by > > doing s/PANIC/ERROR/, rather the contrary. It takes extra smarts to only > > ERROR, often that's not warranted. > > People get cranky when the database PANICs because of a filesystem > failure. We should avoid that, especially when it's trivial to do so. > The update to shared memory should be done second and should be set > up to be no-fail. I don't see how that would help. If we fail during unlink/rmdir, we don't really know at which point we failed. Just keeping the slot in memory, won't help us in any way - we'll continue to reserve resources while the slot is half-gone. I don't think trying to handle errors we don't understand and we don't routinely expect actually improves robustness. It just leads to harder to diagnose errors. It's not like the cases here are likely to be caused by anthything but severe admin failure like removing the write permissions of the postgres directory while the server is running. Or do you see more valid causes? 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