postgresql/src/include
Heikki Linnakangas 81c4508196 Fix race condition between hot standby and restoring a full-page image.
There was a window in RestoreBackupBlock where a page would be zeroed out,
but not yet locked. If a backend pinned and locked the page in that window,
it saw the zeroed page instead of the old page or new page contents, which
could lead to missing rows in a result set, or errors.

To fix, replace RBM_ZERO with RBM_ZERO_AND_LOCK, which atomically pins,
zeroes, and locks the page, if it's not in the buffer cache already.

In stable branches, the old RBM_ZERO constant is renamed to RBM_DO_NOT_USE,
to avoid breaking any 3rd party extensions that might use RBM_ZERO. More
importantly, this avoids renumbering the other enum values, which would
cause even bigger confusion in extensions that use ReadBufferExtended, but
haven't been recompiled.

Backpatch to all supported versions; this has been racy since hot standby
was introduced.
2014-11-13 20:02:37 +02:00
..
access Rename pending_list_cleanup_size to gin_pending_list_limit. 2014-11-13 12:14:48 +09:00
bootstrap Add some noreturn attributes based on compiler recommendations 2014-08-13 22:40:48 -04:00
catalog Add generate_series(numeric, numeric). 2014-11-11 21:44:46 +09:00
commands Move the backup-block logic from XLogInsert to a new file, xloginsert.c. 2014-11-06 13:55:36 +02:00
common pgindent run for 9.4 2014-05-06 12:12:18 -04:00
datatype pgindent run for 9.4 2014-05-06 12:12:18 -04:00
executor Ensure that RowExprs and whole-row Vars produce the expected column names. 2014-11-10 15:21:09 -05:00
foreign Implement IMPORT FOREIGN SCHEMA. 2014-07-10 15:01:43 -04:00
lib pgindent run for 9.4 2014-05-06 12:12:18 -04:00
libpq Fix thinko in commit 2bd9e412f9. 2014-11-05 17:12:23 -05:00
mb pgindent run for 9.4 2014-05-06 12:12:18 -04:00
nodes Ensure that RowExprs and whole-row Vars produce the expected column names. 2014-11-10 15:21:09 -05:00
optimizer Introduce custom path and scan providers. 2014-11-07 17:34:36 -05:00
parser Implement SKIP LOCKED for row-level locks 2014-10-07 17:23:34 -03:00
port Add native compiler and memory barriers for solaris studio. 2014-10-25 11:11:39 +02:00
portability pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postmaster Add some noreturn attributes based on compiler recommendations 2014-08-13 22:40:48 -04:00
regex pgindent run for 9.4 2014-05-06 12:12:18 -04:00
replication Move the backup-block logic from XLogInsert to a new file, xloginsert.c. 2014-11-06 13:55:36 +02:00
rewrite Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
snowball pgindent run for 9.4 2014-05-06 12:12:18 -04:00
storage Fix race condition between hot standby and restoring a full-page image. 2014-11-13 20:02:37 +02:00
tcop pgindent run for 9.4 2014-05-06 12:12:18 -04:00
tsearch Allow opclasses to provide tri-valued GIN consistent functions. 2014-03-12 17:51:30 +02:00
utils Move the guts of our Levenshtein implementation into core. 2014-11-13 12:33:26 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
Makefile Install all headers for the new atomics API. 2014-10-02 16:52:21 +02:00
c.h Add a basic atomic ops API abstracting away platform/architecture details. 2014-09-25 23:49:05 +02:00
fmgr.h Add PG_RETURN_UINT16 macro. 2014-08-06 16:11:43 -04:00
funcapi.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
getaddrinfo.h Fix assorted issues in client host name lookup. 2014-04-02 17:11:24 -04:00
getopt_long.h Add support for optional_argument to our own getopt_long() implementation. 2014-09-10 17:21:50 +02:00
miscadmin.h Add a function to get the authenticated user ID. 2014-10-23 08:18:45 -04:00
pg_config.h.in Add native compiler and memory barriers for solaris studio. 2014-10-25 11:11:39 +02:00
pg_config.h.win32 Add a basic atomic ops API abstracting away platform/architecture details. 2014-09-25 23:49:05 +02:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Rename CACHE_LINE_SIZE to PG_CACHE_LINE_SIZE. 2014-10-01 12:17:03 +02:00
pg_getopt.h Fix comment. 2014-05-08 12:42:56 -04:00
pg_trace.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pgstat.h Save pg_stat_statements statistics file into $PGDATA/pg_stat directory at shutdown. 2014-06-04 12:09:45 +09:00
pgtar.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pgtime.h Support timezone abbreviations that sometimes change. 2014-10-16 15:22:10 -04:00
port.h Declare mkdtemp() only if we're providing it. 2014-10-17 22:55:20 -04:00
postgres.h Fix typos in comments. 2014-07-07 19:39:42 +09:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
rusagestub.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
windowapi.h Update copyright for 2014 2014-01-07 16:05:30 -05:00