postgresql/src/include/access
Alvaro Herrera 722acf51a0 Handle wraparound during truncation in multixact/members
In pg_multixact/members, relying on modulo-2^32 arithmetic for
wraparound handling doesn't work all that well.  Because we don't
explicitely track wraparound of the allocation counter for members, it
is possible that the "live" area exceeds 2^31 entries; trying to remove
SLRU segments that are "old" according to the original logic might lead
to removal of segments still in use.  To fix, have the truncation
routine use a tailored SlruScanDirectory callback that keeps track of
the live area in actual use; that way, when the live range exceeds 2^31
entries, the oldest segments still live will not get removed untimely.

This new SlruScanDir callback needs to take care not to remove segments
that are "in the future": if new SLRU segments appear while the
truncation is ongoing, make sure we don't remove them.  This requires
examination of shared memory state to recheck for false positives, but
testing suggests that this doesn't cause a problem.  The original coding
didn't suffer from this pitfall because segments created when truncation
is running are never considered to be removable.

Per Andres Freund's investigation of bug #8673 reported by Serge
Negodyuck.
2014-01-02 18:16:54 -03:00
..
attnum.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
clog.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
genam.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
gin_private.h Get rid of the post-recovery cleanup step of GIN page splits. 2013-11-27 19:21:23 +02:00
gin.h Get rid of the post-recovery cleanup step of GIN page splits. 2013-11-27 19:21:23 +02:00
gist_private.h Support unlogged GiST index. 2013-02-11 23:07:09 +02:00
gist.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
gistscan.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
hash.h Provide database object names as separate fields in error messages. 2013-01-29 17:08:26 -05:00
heapam_xlog.h Change the way we mark tuples as frozen. 2013-12-22 15:49:09 -05:00
heapam.h Use an MVCC snapshot, rather than SnapshotNow, for catalog scans. 2013-07-02 09:47:01 -04:00
hio.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
htup_details.h Change the way we mark tuples as frozen. 2013-12-22 15:49:09 -05:00
htup.h Improve concurrency of foreign key locking 2013-01-23 12:04:59 -03:00
itup.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
multixact.h Don't ignore tuple locks propagated by our updates 2013-12-18 13:45:51 -03:00
nbtree.h Provide database object names as separate fields in error messages. 2013-01-29 17:08:26 -05:00
printtup.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
reloptions.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
relscan.h Use an MVCC snapshot, rather than SnapshotNow, for catalog scans. 2013-07-02 09:47:01 -04:00
rewriteheap.h Rename various "freeze multixact" variables 2013-09-16 15:47:31 -03:00
rmgr.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
rmgrlist.h Get rid of the post-recovery cleanup step of GIN page splits. 2013-11-27 19:21:23 +02:00
sdir.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
skey.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
slru.h Handle wraparound during truncation in multixact/members 2014-01-02 18:16:54 -03:00
spgist_private.h Avoid deadlocks during insertion into SP-GiST indexes. 2013-06-14 14:26:43 -04:00
spgist.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
subtrans.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
sysattr.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
timeline.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
transam.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tupconvert.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tupdesc.h Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
tupmacs.h Consistently use unsigned arithmetic for alignment calculations. 2013-10-20 21:04:52 -04:00
tuptoaster.h Get rid of pg_class.reltoastidxid. 2013-07-04 03:24:09 +09:00
twophase_rmgr.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
twophase.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
valid.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
visibilitymap.h Allow I/O reliability checks using 16-bit checksums 2013-03-22 13:54:07 +00:00
xact.h Add new wal_level, logical, sufficient for logical decoding. 2013-12-10 19:01:40 -05:00
xlog_fn.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
xlog_internal.h Change the way we mark tuples as frozen. 2013-12-22 15:49:09 -05:00
xlog.h Rename walLogHints to wal_log_hints for easier grepping. 2014-01-01 20:17:00 -05:00
xlogdefs.h Improve scalability of WAL insertions. 2013-07-08 11:23:56 +03:00
xlogreader.h Use the right timeline when beginning to stream from master. 2013-01-18 11:46:49 +02:00
xlogutils.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00