Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ws9Te-0001Gi-Ut for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Jun 2014 11:35:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ws9Te-0002dY-DM for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Jun 2014 11:35:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ws9Td-0002cq-IV for pgsql-bugs@postgresql.org; Wed, 04 Jun 2014 11:35:29 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ws9TZ-0001Kk-Qr for pgsql-bugs@postgresql.org; Wed, 04 Jun 2014 11:35:27 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 7536A4E8007; Wed, 4 Jun 2014 13:35:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-4.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC6A0F.dip0.t-ipconnect.de [93.220.106.15]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 402FC4E8007; Wed, 4 Jun 2014 13:35:20 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id C76021002C9; Wed, 4 Jun 2014 13:35:19 +0200 (CEST) Date: Wed, 4 Jun 2014 13:35:19 +0200 From: Andres Freund To: Greg Stark Cc: Heikki Linnakangas , Maciek Sakrejda , PostgreSQL Bugs Subject: Re: BUG #10432: failed to re-find parent key in index Message-ID: <20140604113519.GG1220@awork2.anarazel.de> References: <20140529171934.GP27914@awork2.anarazel.de> <538839CF.5080007@vmware.com> <20140602174007.GF24145@awork2.anarazel.de> <20140603094337.GJ24145@awork2.anarazel.de> 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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, On 2014-06-04 12:14:27 +0100, Greg Stark wrote: > Ok, I made some progress. It turns out this was a pre-existing problem > in the master. They've been getting "failed to re-find parent" errors > for weeks. Far longer than I have any WAL or backups for. Ok. > 1) Failed to re-find parent should perhaps not be FATAL to recovery. > In fact any index replay error would really be nice not to have to > crash on. I think that's not really realistic. We'd need to put a significant amount of machinery for this in to be workable. Suddenly a crash restart doesn't guarantee that you're indexes are there anymore? Not nice. > All crashing does is prevent the user from being able to > bring up their database and REINDEX the btree. This may be another use > case for the machinery that would protect against corrupt hash indexes > or user-defined indexes -- if we could mark the index invalid and > proceed (perhaps ignoring subsequent records for it) that would be > great. > > 2) When we see an abort record we could check for any cleanup actions > triggered by that transaction and run them right away. I think the > checkpoints (and maybe hot standby snapshots or vacuum cleanup > records?) also include information about the oldest xid running, they > would also let us prune the cleanup actions sooner. That would at > least find the error sooner. In conjunction with (1) it would also > mean subsequent restartpoints would be effective instead of > suppressing restartpoints right to the end of recovery. Heikki removed restartpoints from 9.4 alltogether so most of these are gone. As all these -even if they were doable - sound far too large for backpatching I think it's luckily mostly done. > 3) The lack of logs around an error during recovery makes it hard to > decipher what's going on. It would be nice to see "Beginning Xlog > cleanup (1 incomplete splits to replay)" and when it crashed "Last > safe point to restart recovery is 324/ABCDEF". As it was it was a > pretty big mystery why the database crashed, the logs made it appear > as if it had started up fine. And it was unclear why restarting it > caused it to replay from the beginning, I thought maybe something was > wrong with our scripts. I think this should be fixed by setting up error context stack support in two places. a) in StartupXLOG() before the rm_cleanup() calls b) in < 9.4 inside the individual cleanup routines. We do all that around redo routines, but, as evidenced here, that's not always enough. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs