pgsql: Perform a lot more sanity checks when freezing tuples.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Perform a lot more sanity checks when freezing tuples.
Date: 2017-12-15 02:28:47
Message-ID: E1ePfjz-0005OV-Qn@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Perform a lot more sanity checks when freezing tuples.

The previous commit has shown that the sanity checks around freezing
aren't strong enough. Strengthening them seems especially important
because the existance of the bug has caused corruption that we don't
want to make even worse during future vacuum cycles.

The errors are emitted with ereport rather than elog, despite being
"should never happen" messages, so a proper error code is emitted. To
avoid superflous translations, mark messages as internal.

Author: Andres Freund and Alvaro Herrera
Reviewed-By: Alvaro Herrera, Michael Paquier
Discussion: https://postgr.es/m/20171102112019.33wb7g5wp4zpjelu@alap3.anarazel.de
Backpatch: 9.3-

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d3044f8b0732d369ad255c9268e2feb42acae2a0

Modified Files
--------------
src/backend/access/heap/heapam.c | 112 ++++++++++++++++++++++++++++------
src/backend/access/heap/rewriteheap.c | 5 +-
src/backend/commands/vacuumlazy.c | 15 ++++-
src/include/access/heapam.h | 5 +-
src/include/access/heapam_xlog.h | 2 +
5 files changed, 114 insertions(+), 25 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-12-15 02:28:49 pgsql: Fix pruning of locked and updated tuples.
Previous Message Andres Freund 2017-12-15 02:28:45 pgsql: Perform a lot more sanity checks when freezing tuples.