v1_comments_amit.1.patch.txt

text/plain

Filename: v1_comments_amit.1.patch.txt
Type: text/plain
Part: 0
Message: Re: Fix premature xmin advancement during fast forward decoding
diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c
index 8dc467a8bb3..cc03f0706e9 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -413,10 +413,10 @@ heap2_decode(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
 	/*
 	 * If we don't have snapshot or we are just fast-forwarding, there is no
 	 * point in decoding data changes. However, it's crucial to build the base
-	 * snapshot during fast-forward mode (as done in SnapBuildProcessChange())
-	 * because the snapshot's minimum visible transaction ID (xmin) must be
-	 * referenced when determining the candidate catalog_xmin for the
-	 * replication slot.
+	 * snapshot during fast-forward mode (as is done in
+	 * SnapBuildProcessChange()) because we require the snapshot's xmin when
+	 * determining the candidate catalog_xmin for the replication slot. See
+	 * SnapBuildProcessRunningXacts().
 	 */
 	if (SnapBuildCurrentState(builder) < SNAPBUILD_FULL_SNAPSHOT)
 		return;
@@ -477,10 +477,10 @@ heap_decode(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
 	/*
 	 * If we don't have snapshot or we are just fast-forwarding, there is no
 	 * point in decoding data changes. However, it's crucial to build the base
-	 * snapshot during fast-forward mode (as done in SnapBuildProcessChange())
-	 * because the snapshot's minimum visible transaction ID (xmin) must be
-	 * referenced when determining the candidate catalog_xmin for the
-	 * replication slot.
+	 * snapshot during fast-forward mode (as is done in
+	 * SnapBuildProcessChange()) because we require the snapshot's xmin when
+	 * determining the candidate catalog_xmin for the replication slot. See
+	 * SnapBuildProcessRunningXacts().
 	 */
 	if (SnapBuildCurrentState(builder) < SNAPBUILD_FULL_SNAPSHOT)
 		return;