pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Andres Freund <andres@2ndquadrant.com>
Cc: Sergey Konoplev <gray.ru@gmail.com>
Cc: matioli.matheus@gmail.com
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: Максим Панченко <Panchenko@gw.tander.ru>
Cc: Сизов Сергей Павлович <sizov_sp@gw.tander.ru>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [BUGS] Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
Date: Tue, 14 Jan 2014 17:52:52 -0500
Message-ID: <1164.1389739972@sss.pgh.pa.us> (raw)
In-Reply-To: <52D54198.7090802@vmware.com>
References: <CAL_0b1s4QCkFy_55kk_8XWcJPs7wsgVWf8vn4=jXe6V4R7Hxmg@mail.gmail.com>
	<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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (36+ messages)  latest in thread

Message-ID: <1164.1389739972@sss.pgh.pa.us>
Permalink:  ../1164.1389739972@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1164.1389739972@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hlinnakangas@vmware.com, andres@2ndquadrant.com, gray.ru@gmail.com, matioli.matheus@gmail.com, maxim.boguk@gmail.com, Panchenko@gw.tander.ru, sizov_sp@gw.tander.ru, 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: <1164.1389739972@sss.pgh.pa.us>
  References: <CAL_0b1s4QCkFy_55kk_8XWcJPs7wsgVWf8vn4=jXe6V4R7Hxmg@mail.gmail.com> <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> <1164.1389739972@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox