aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/access/transam/xlog.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 03e711a7f4c..f78a0882deb 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7119,10 +7119,17 @@ CreateCheckPoint(int flags)
* If we are shutting down, or Startup process is completing crash
* recovery we don't need to write running xact data.
*
- * Update checkPoint.nextXid since we have a later value
+ * Update checkPoint.nextXid since we may have a later value. If we
+ * do update the value, and we have wrapped, increment epoch also.
*/
if (!shutdown && XLogStandbyInfoActive())
+ {
+ TransactionId prevXid = checkPoint.nextXid;
+
LogStandbySnapshot(&checkPoint.nextXid);
+ if (checkPoint.nextXid < prevXid)
+ checkPoint.nextXidEpoch++;
+ }
START_CRIT_SECTION();