postgresql/src/backend
Alexander Korotkov 05e6e78c18 Reset lastOverflowedXid on standby when needed
Currently, lastOverflowedXid is never reset.  It's just adjusted on new
transactions known to be overflowed.  But if there are no overflowed
transactions for a long time, snapshots could be mistakenly marked as
suboverflowed due to wraparound.

This commit fixes this issue by resetting lastOverflowedXid when needed
altogether with KnownAssignedXids.

Backpatch to all supported versions.

Reported-by: Stan Hu
Discussion: https://postgr.es/m/CAMBWrQ%3DFp5UAsU_nATY7EMY7NHczG4-DTDU%3DmCvBQZAQ6wa2xQ%40mail.gmail.com
Author: Kyotaro Horiguchi, Alexander Korotkov
Reviewed-by: Stan Hu, Simon Riggs, Nikolay Samokhvalov, Andrey Borodin, Dmitry Dolgov
2021-11-06 19:13:58 +03:00
..
access Update obsolete reference in vacuumlazy.c. 2021-11-05 23:38:07 -07:00
bootstrap Fix bogus assertion in BootstrapModeMain(). 2021-08-09 08:28:53 -07:00
catalog Avoid crash in rare case of concurrent DROP 2021-11-05 12:29:35 -03:00
commands Fix typos in comments 2021-10-27 22:38:38 +02:00
executor Fix variable lifespan in ExecInitCoerceToDomain(). 2021-11-02 13:36:47 -04:00
foreign Improve HINT message that FDW reports when there are no valid options. 2021-10-27 00:46:52 +09:00
jit Avoid some other O(N^2) hazards in list manipulation. 2021-11-01 16:24:39 -04:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Fix snapshot reference leak if lo_export fails. 2021-11-03 10:52:38 +02:00
main process startup: Split single user code out of PostgresMain(). 2021-09-17 19:56:47 -07:00
nodes Avoid O(N^2) behavior in SyncPostCheckpoint(). 2021-11-02 11:31:54 -04:00
optimizer Avoid O(N^2) behavior in SyncPostCheckpoint(). 2021-11-02 11:31:54 -04:00
parser Avoid O(N^2) behavior in SyncPostCheckpoint(). 2021-11-02 11:31:54 -04:00
partitioning Fix duplicate words in comments 2021-10-04 15:12:57 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Reject huge_pages=on if shared_memory_type=sysv. 2021-10-26 12:54:55 +13:00
postmaster Fix race condition in startup progress reporting. 2021-10-29 14:40:15 -04:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:31 -04:00
replication Remove all use of ThisTimeLineID global variable outside of xlog.c 2021-11-05 12:50:01 -04:00
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:47 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
storage Reset lastOverflowedXid on standby when needed 2021-11-06 19:13:58 +03:00
tcop Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
tsearch Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
utils Allow publishing the tables of schema. 2021-10-27 07:44:52 +05:30
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00