postgresql/src/backend
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
..
access Don't advance checkPoint.nextXid near the end of a checkpoint sequence. 2012-12-02 15:20:08 -05:00
bootstrap Capitalization fixes 2011-06-19 00:39:19 +03:00
catalog Fix assorted bugs in CREATE INDEX CONCURRENTLY. 2012-11-29 14:51:46 -05:00
commands Add missing buffer lock acquisition in GetTupleForTrigger(). 2012-11-30 13:56:04 -05:00
executor Fix assorted bugs in CREATE INDEX CONCURRENTLY. 2012-11-29 14:51:46 -05:00
foreign deflist_to_tuplestore dumped core on an option with no value. 2011-09-13 11:36:53 -04:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Produce a more useful error message for over-length Unix socket paths. 2012-11-29 19:57:17 -05:00
main Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
nodes Fix planning of non-strict equivalence clauses above outer joins. 2012-10-18 12:29:00 -04:00
optimizer Fix assorted bugs in CREATE INDEX CONCURRENTLY. 2012-11-29 14:51:46 -05:00
parser Fix assorted bugs in CREATE INDEX CONCURRENTLY. 2012-11-29 14:51:46 -05:00
po Translation updates 2012-09-19 00:03:54 -04:00
port Split up process latch initialization for more-fail-soft behavior. 2012-10-14 23:00:07 -04:00
postmaster Don't launch new child processes after we've been told to shut down. 2012-11-21 15:18:47 -05:00
regex Prevent corner-case core dump in rfree(). 2012-07-15 13:28:09 -04:00
replication pg_stat_replication.sync_state was displayed incorrectly at page boundary. 2012-11-23 19:14:41 +02:00
rewrite Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars. 2012-06-30 16:44:03 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Don't advance checkPoint.nextXid near the end of a checkpoint sequence. 2012-12-02 15:20:08 -05:00
tcop Say ANALYZE, not VACUUM, in error message on analyze in hot standby. 2012-10-08 14:20:56 +03:00
tsearch Fix logical errors in tsquery selectivity estimation for prefix queries. 2012-09-11 21:23:49 -04:00
utils Fix assorted bugs in CREATE INDEX CONCURRENTLY. 2012-11-29 14:51:46 -05:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
Makefile Fix PGXS support for building loadable modules on AIX. 2012-10-09 21:04:15 -04:00
nls.mk Translation updates 2012-02-23 20:40:55 +02:00