Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W0BR4-0007rx-7N for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2014 14:45:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W0BR3-000691-NG for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2014 14:45:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W0BR3-00068v-4P for pgsql-bugs@postgresql.org; Mon, 06 Jan 2014 14:45:45 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W0BR0-0007np-6U for pgsql-bugs@postgresql.org; Mon, 06 Jan 2014 14:45:44 +0000 Received: from intern.anarazel.de (unknown [88.128.80.7]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 8B2B34F0001; Mon, 6 Jan 2014 15:45:40 +0100 (CET) Date: Mon, 6 Jan 2014 15:45:32 +0100 From: Andres Freund To: Heikki Linnakangas Cc: Sergey Konoplev , matioli.matheus@gmail.com, pgsql-bugs , Maxim Boguk , =?utf-8?B?0JzQsNC60YHQuNC8INCf0LDQvdGH0LXQvdC60L4=?= , =?utf-8?B?0KHQuNC30L7QsiDQodC10YDQs9C10Lkg0J/QsNCy0LvQvtCy0LjRhw==?= Subject: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages Message-ID: <20140106144532.GH28320@alap2.anarazel.de> References: <20140106134815.GE28320@alap2.anarazel.de> <52CABF3E.2050004@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52CABF3E.2050004@vmware.com> X-Pg-Spam-Score: -1.8 (-) 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 On 2014-01-06 16:35:42 +0200, Heikki Linnakangas wrote: > >In btree_xlog_vacuum() we scan all the pages between lastBlockVacuumed > >and the page vacuumed and acquire a cleanup lock on it. But there isn't > >any guarantee that the intermediate pages are valid, filled pages, > >afaics. > > Hmm. So the problem arises if there's an uninitialized page in the middle of > the b-tree relation for some reason. It's unusual for an uninitialized page > to be left in the middle of the relation, but it's certainly possible, if > e.g you crash just after extending the relation. In a heap, vacuum will > initialize such pages and emit a WARNING like "page %u is uninitialized --- > fixing", but we don't do that for b-tree. Yes. There's probably some resource exhaustion scenarios that can cause this as well. Triggering *_timeout or out-of-memory errors at least... > >ISTM we can just use RBM_ZERO_ON_ERROR instead of RBM_NORMAL. > > That'd be horrendously dangerous. It would silently zap any page with any > error on it. Well, the number of scenarios in which you can hit that is somewhat limited - it's not going to be ENOSPC since the file is guaranteed to be longer, and we don't create holes - so the scenario pretty much is disk reads not returning (pretty rare) and checksums failing. > But we could add a new ReadBufferMode that returns > InvalidBuffer on error, without zeroing the page. But yes, that's much better. 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