postgresql/src
Andres Freund 7b28913bca Fix and test snapshot behavior on standby.
I (Andres) broke this in 623a9CA79bx, because I didn't think about the
way snapshots are built on standbys sufficiently. Unfortunately our
existing tests did not catch this, as they are all just querying with
psql (therefore ending up with fresh snapshots).

The fix is trivial, we just need to increment the transaction
completion counter in ExpireTreeKnownAssignedTransactionIds(), which
is the equivalent of ProcArrayEndTransaction() during recovery.

This commit also adds a new test doing some basic testing of the
correctness of snapshots built on standbys. To avoid the
aforementioned issue of one-shot psql's not exercising the snapshot
caching, the test uses a long lived psqls, similar to
013_crash_restart.pl. It'd be good to extend the test further.

Reported-By: Ian Barwick <ian.barwick@2ndquadrant.com>
Author: Andres Freund <andres@anarazel.de>
Author: Ian Barwick <ian.barwick@2ndquadrant.com>
Discussion: https://postgr.es/m/61291ffe-d611-f889-68b5-c298da9fb18f@2ndquadrant.com
2020-09-30 17:28:51 -07:00
..
backend Fix and test snapshot behavior on standby. 2020-09-30 17:28:51 -07:00
bin pgbench: Use PQExpBuffer to simplify code that constructs SQL. 2020-09-30 10:58:09 +03:00
common Revert "Change SHA2 implementation based on OpenSSL to use EVP digest routines" 2020-09-29 09:25:51 +09:00
fe_utils Standardize the printf format for st_size 2020-09-24 21:04:21 +02:00
include Add for_each_from, to simplify loops starting from non-first list cells. 2020-09-28 20:33:13 -04:00
interfaces Remove arbitrary line length limit for libpq service files. 2020-09-22 15:59:23 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Fix memory leak in plpgsql's CALL processing. 2020-09-29 11:18:30 -04:00
port Add d_type to our Windows dirent emulation. 2020-09-07 23:38:19 +12:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Fix and test snapshot behavior on standby. 2020-09-30 17:28:51 -07:00
timezone Ensure that distributed timezone abbreviation files are plain ASCII. 2020-07-17 11:03:55 -04:00
tools Defer flushing of SLRU files. 2020-09-25 19:00:15 +12:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00