postgresql/src/backend/access
Alvaro Herrera d2599ecfcc Don't mark pages all-visible spuriously
Dan Wood diagnosed a long-standing problem that pages containing tuples
that are locked by multixacts containing live lockers may spuriously end
up as candidates for getting their all-visible flag set.  This has the
long-term effect that multixacts remain unfrozen; this may previously
pass undetected, but since commit XYZ it would be reported as
  "ERROR: found multixact 134100944 from before relminmxid 192042633"
because when a later vacuum tries to freeze the page it detects that a
multixact that should have gotten frozen, wasn't.

Dan proposed a (correct) patch that simply sets a variable to its
correct value, after a bogus initialization.  But, per discussion, it
seems better coding to avoid the bogus initializations altogether, since
they could give rise to more bugs later.  Therefore this fix rewrites
the logic a little bit to avoid depending on the bogus initializations.

This bug was part of a family introduced in 9.6 by commit a892234f830e;
later, commit 38e9f90a22 fixed most of them, but this one was
unnoticed.

Authors: Dan Wood, Pavan Deolasee, Álvaro Herrera
Reviewed-by: Masahiko Sawada, Pavan Deolasee, Álvaro Herrera
Discussion: https://postgr.es/m/84EBAC55-F06D-4FBE-A3F3-8BDA093CE3E3@amazon.com
2018-05-04 18:24:45 -03:00
..
brin Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
common Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
gin Re-think predicate locking on GIN indexes. 2018-05-04 11:27:50 +03:00
gist Re-think predicate locking on GIN indexes. 2018-05-04 11:27:50 +03:00
hash Clean up warnings from -Wimplicit-fallthrough. 2018-05-01 19:35:08 -04:00
heap Don't mark pages all-visible spuriously 2018-05-04 18:24:45 -03:00
index Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
nbtree Don't truncate away non-key attributes for leftmost downlinks. 2018-05-04 12:38:23 +03:00
rmgrdesc Handle XLOG_BTREE_META_CLEANUP in btree_desc() and btree_identify() 2018-04-19 09:27:56 +03:00
spgist Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
tablesample Update copyright for 2018 2018-01-02 23:30:12 -05:00
transam Add HOLD_INTERRUPTS section into FinishPreparedTransaction. 2018-05-03 20:08:29 +03:00
Makefile TABLESAMPLE, SQL Standard and extensible 2015-05-15 14:37:10 -04:00