postgresql/src
Tom Lane d08fd1f849 Don't advance checkPoint.nextXid near the end of a checkpoint sequence.
This reverts commit c11130690d in favor of
actually fixing the problem: namely, that we should never have been
modifying the checkpoint record's nextXid at this point to begin with.
The nextXid should match the state as of the checkpoint's logical WAL
position (ie the redo point), not the state as of its physical position.
It's especially bogus to advance it in some wal_levels and not others.
In any case there is no need for the checkpoint record to carry the
same nextXid shown in the XLOG_RUNNING_XACTS record just emitted by
LogStandbySnapshot, as any replay operation will already have adopted
that value as current.

This fixes bug #7710 from Tarvi Pillessaar, and probably also explains bug
#6291 from Daniel Farina, in that if a checkpoint were in progress at the
instant of XID wraparound, the epoch bump would be lost as reported.
(And, of course, these days there's at least a 50-50 chance of a checkpoint
being in progress at any given instant.)

Diagnosed by me and independently by Andres Freund.  Back-patch to all
branches supporting hot standby.
2012-12-02 15:20:08 -05:00
..
backend Don't advance checkPoint.nextXid near the end of a checkpoint sequence. 2012-12-02 15:20:08 -05:00
bin Fix psql crash while parsing SQL file whose encoding is different from 2012-12-02 21:21:40 +09:00
include Don't advance checkPoint.nextXid near the end of a checkpoint sequence. 2012-12-02 15:20:08 -05:00
interfaces Produce a more useful error message for over-length Unix socket paths. 2012-11-29 19:57:17 -05:00
makefiles Make sure sharedir/extension/ directory is created when needed. 2012-12-01 16:04:50 -05:00
pl Back-patch fix and test case for bug #7516. 2012-09-14 11:50:06 -04:00
port Stamp 9.1.6. 2012-09-19 17:50:31 -04:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Prevent passing gmake's environment variables down through pg_regress. 2012-12-01 17:24:01 -05:00
timezone Update time zone data files to tzdata release 2012f. 2012-09-19 10:45:22 -04:00
tools Fix MSVC builds broken by xsubpp change 2011-11-27 01:23:00 -05:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:27 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
nls-global.mk Fix makefile logic to not break the build when xgettext is missing 2010-10-14 23:16:46 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00