Re: [BUGS] Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>, matioli(dot)matheus(at)gmail(dot)com, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>, Максим Панченко <Panchenko(at)gw(dot)tander(dot)ru>, Сизов Сергей Павлович <sizov_sp(at)gw(dot)tander(dot)ru>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUGS] Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages
Date: 2014-01-14 22:52:52
Message-ID: 1164.1389739972@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-01-14 23:21:46 Re: An odd thing with postgresql92-debuginfo-9.2.6-1PGDG.rhel6.x86_64.rpm
Previous Message Sergey Konoplev 2014-01-14 21:57:35 An odd thing with postgresql92-debuginfo-9.2.6-1PGDG.rhel6.x86_64.rpm

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2014-01-14 23:03:39 Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance
Previous Message Jim Nasby 2014-01-14 22:35:21 Re: inherit support for foreign tables