Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3CrE-0005T5-MA for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2014 22:53:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W3CrE-0002Xr-0l for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2014 22:53:16 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3CrC-0002Xe-GG; Tue, 14 Jan 2014 22:53:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3CrA-0008Gx-8T; Tue, 14 Jan 2014 22:53:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s0EMqqxj001165; Tue, 14 Jan 2014 17:52:53 -0500 From: Tom Lane To: Heikki Linnakangas cc: Andres Freund , Sergey Konoplev , matioli.matheus@gmail.com, pgsql-bugs , Maxim Boguk , =?UTF-8?B?0JzQsNC60YHQuNC8INCf0LDQvdGH0LXQvdC60L4=?= , =?UTF-8?B?0KHQuNC30L7QsiDQodC10YDQs9C10Lkg0J/QsA==?= =?UTF-8?B?0LLQu9C+0LLQuNGH?= , pgsql-hackers@postgresql.org Subject: Re: [BUGS] Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages In-reply-to: <52D54198.7090802@vmware.com> References: <20140106134815.GE28320@alap2.anarazel.de> <52CABF3E.2050004@vmware.com> <17450.1389644346@sss.pgh.pa.us> <20140113202600.GB14861@awork2.anarazel.de> <52D44F40.1000803@vmware.com> <20140113210245.GD14861@awork2.anarazel.de> <52D45AD7.9080406@vmware.com> <20140113220440.GE5838@awork2.anarazel.de> <25048.1389662159@sss.pgh.pa.us> <20140114011851.GA20335@awork2.anarazel.de> <26165.1389664788@sss.pgh.pa.us> <52D54198.7090802@vmware.com> Comments: In-reply-to Heikki Linnakangas message dated "Tue, 14 Jan 2014 15:54:32 +0200" Date: Tue, 14 Jan 2014 17:52:52 -0500 Message-ID: <1164.1389739972@sss.pgh.pa.us> X-Pg-Spam-Score: -2.0 (--) 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 I've pushed patches fixing the issues discussed in this thread. While I was working on it, it occurred to me that the whole darn mess might be dead code as of the removal of SnapshotNow. The reason we're doing this at all is the fear that, while some indexscan is in flight from an index entry to the relevant heap tuple, VACUUM could remove said tuple and then somebody else could insert a new, unrelated tuple at the now-vacant TID. With ordinary MVCC snapshot checking, this would not be a problem because the new tuple could not possibly pass the snapshot check, so it wouldn't get returned. However, with non-MVCC snapshots, it's possible we could return a heap tuple that doesn't match the index qual. The fear of this happening for SnapshotNow catalog accesses was what drove the original locking design, and that is also why we don't bother with similar locking for other index types --- only btree indexes are used for system catalog fetches. So now that we use MVCC snapshots for system catalog fetches, it seems like maybe we don't need to sweat about cleanup-locking index pages we're not going to remove tuples from; indeed maybe we don't need to acquire super-exclusive btree page locks at all. I'm not totally sure about this; we still have SnapshotSelf for instance. But maybe the remaining non-MVCC snapshot types are never used in ways where this type of aliasing would be a problem, or maybe we could cause that to become true with a bit more work. I'm not planning to pursue the question myself at the moment, but I thought I should mention it in case anybody else wants to. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers