Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W0BHX-0007P3-Se for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2014 14:35:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W0BHX-0007QM-8H for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2014 14:35:55 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W0BHW-0007QC-Ho for pgsql-bugs@postgresql.org; Mon, 06 Jan 2014 14:35:54 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W0BHS-0001ru-2B for pgsql-bugs@postgresql.org; Mon, 06 Jan 2014 14:35:52 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 59E9028185; Mon, 6 Jan 2014 06:35:48 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 5383BB0476; Mon, 6 Jan 2014 06:35:48 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 0E84112002F; Mon, 6 Jan 2014 06:36:59 -0800 (PST) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Mon, 6 Jan 2014 06:36:55 -0800 (PST) Message-ID: <52CABF3E.2050004@vmware.com> Date: Mon, 06 Jan 2014 16:35:42 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: Andres Freund CC: Sergey Konoplev , matioli.matheus@gmail.com, pgsql-bugs , Maxim Boguk , =?UTF-8?B?0JzQsNC60YHQuNC8INCf0LDQvQ==?= =?UTF-8?B?0YfQtdC90LrQvg==?= , =?UTF-8?B?0KHQuNC3?= =?UTF-8?B?0L7QsiDQodC10YDQs9C10Lkg0J/QsNCy0LvQvtCy0LjRhw==?= Subject: Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages References: <20140106134815.GE28320@alap2.anarazel.de> In-Reply-To: <20140106134815.GE28320@alap2.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.2 (-------) 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 01/06/2014 03:48 PM, Andres Freund wrote: > Hi, > > On 2013-12-19 14:37:04 -0800, Sergey Konoplev wrote: >> 2013-12-19 20:51:22 MSK 19938 @ from [vxid:1/0 txid:0] [] WARNING: >> page 14833 of relation base/16436/3321003988 is uninitialized >> 2013-12-19 20:51:22 MSK 19938 @ from [vxid:1/0 txid:0] [] CONTEXT: >> xlog redo vacuum: rel 1663/16436/3321003988; blk 38538, >> lastBlockVacuumed 0 >> 2013-12-19 20:51:22 MSK 19938 @ from [vxid:1/0 txid:0] [] PANIC: WAL >> contains references to invalid pages >> 2013-12-19 20:51:22 MSK 19938 @ from [vxid:1/0 txid:0] [] CONTEXT: >> xlog redo vacuum: rel 1663/16436/3321003988; blk 38538, >> lastBlockVacuumed 0 >> 2013-12-19 20:51:22 MSK 19935 @ from [vxid: txid:0] [] LOG: startup >> process (PID 19938) was terminated by signal 6: Aborted >> 2013-12-19 20:51:22 MSK 19935 @ from [vxid: txid:0] [] LOG: >> terminating any other active server processes > > There just was another case of this reported on IRC by MatheusOl and for > some reason in his case I noticed the pertinent details and it quickly > clicked: > * page 14833 is the one with the error > * we're actually vacuuming page 38538 > * lastBlockVacuumed is 0 > > 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. > 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. But we could add a new ReadBufferMode that returns InvalidBuffer on error, without zeroing the page. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs