Reset lastOverflowedXid on standby when needed

Alexander Korotkov <akorotkov@postgresql.org>

Commit: b0f6bd48f35ddfe4195804eb8197f477c88da6d2
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2021-11-06T16:13:53Z
Releases: 14.1
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

Files

PathChange+/−
src/backend/storage/ipc/procarray.c modified +19 −2

Discussion