postgresql/src/backend
Tom Lane 7b4fcabb2f Avoid problems with OID wraparound during WAL replay.
Fix a longstanding thinko in replay of NEXTOID and checkpoint records: we
tried to advance nextOid only if it was behind the value in the WAL record,
but the comparison would draw the wrong conclusion if OID wraparound had
occurred since the previous value.  Better to just unconditionally assign
the new value, since OID assignment shouldn't be happening during replay
anyway.

The consequences of a failure to update nextOid would be pretty minimal,
since we have long had the code set up to obtain another OID and try again
if the generated value is already in use.  But in the worst case there
could be significant performance glitches while such loops iterate through
many already-used OIDs before finding a free one.

The odds of a wraparound happening during WAL replay would be small in a
crash-recovery scenario, and the length of any ensuing OID-assignment stall
quite limited anyway.  But neither of these statements hold true for a
replication slave that follows a WAL stream for a long period; its behavior
upon going live could be almost unboundedly bad.  Hence it seems worth
back-patching this fix into all supported branches.

Already fixed in HEAD in commit c6d76d7c82.
2012-02-06 13:14:58 -05:00
..
access Avoid problems with OID wraparound during WAL replay. 2012-02-06 13:14:58 -05:00
bootstrap Avoid changing an index's indcheckxmin horizon during REINDEX. 2011-04-19 18:51:08 -04:00
catalog Avoid crashing when we have problems unlinking files post-commit. 2011-12-20 15:01:03 -05:00
commands Accept a non-existent value in "ALTER USER/DATABASE SET ..." command. 2012-01-30 11:39:50 +02:00
executor Make executor's SELECT INTO code save and restore original tuple receiver. 2012-01-04 18:31:14 -05:00
foreign deflist_to_tuplestore dumped core on an option with no value. 2011-09-13 11:37:03 -04:00
lib Update copyright for 2009. 2009-01-01 17:24:05 +00:00
libpq Use OpenSSL's SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag. 2011-07-24 15:18:07 -04:00
main Update copyright for 2009. 2009-01-01 17:24:05 +00:00
nodes Fix performance problem when building a lossy tidbitmap. 2011-08-20 14:51:43 -04:00
optimizer Fix inline_set_returning_function() to allow multiple OUT parameters. 2011-11-03 17:53:33 -04:00
parser Don't let transform_null_equals=on affect CASE foo WHEN NULL ... constructs. 2011-10-08 11:21:08 +03:00
po Translation updates 2011-12-01 22:47:51 +02:00
port Modernize dlopen interface code for FreeBSD and OpenBSD. 2011-04-07 15:14:51 -04:00
postmaster Fix VACUUM so that it always updates pg_class.reltuples/relpages. 2011-05-30 17:07:19 -04:00
regex Change regexp engine's ccondissect/crevdissect routines to perform DFA 2010-02-01 02:45:35 +00:00
rewrite Make FOR UPDATE/SHARE in the primary query not propagate into WITH queries; 2009-10-27 17:11:30 +00:00
snowball Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:08 +02:00
storage Avoid crashing when we have problems unlinking files post-commit. 2011-12-20 15:01:03 -05:00
tcop On IA64 architecture, we check the depth of the register stack in addition 2011-04-13 11:53:06 +03:00
tsearch Fix tsmatchsel() to account properly for null rows. 2011-02-17 19:01:01 -05:00
utils Accept a non-existent value in "ALTER USER/DATABASE SET ..." command. 2012-01-30 11:39:50 +02:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:08 +02:00
common.mk Code coverage testing with gcov. Documentation is in the regression test 2008-09-05 12:11:18 +00:00
Makefile Well, the systemtap guys moved the goalposts again: with the latest version, 2010-01-20 23:12:15 +00:00
nls.mk Translation updates 2011-09-22 22:31:27 +03:00