0001-Fix-builder-state-in-snapshot-restore-function.patch

application/octet-stream

Filename: 0001-Fix-builder-state-in-snapshot-restore-function.patch
Type: application/octet-stream
Part: 0
Message: 回复:BUG #17695: Failed Assert in logical replication snapbuild.

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch 0001
Subject: Fix builder state in snapshot restore function.
File+
src/backend/replication/logical/snapbuild.c 2 0
From efcd0b6be1dc45c3f49c6e01a3b4f8fde7059897 Mon Sep 17 00:00:00 2001
From: bowenshi <zxwsbg@qq.com>
Date: Thu, 24 Nov 2022 09:30:31 +0000
Subject: [PATCH] Fix builder state in snapshot restore function.

---
 src/backend/replication/logical/snapbuild.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 977440b942..87cb03f08c 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1963,6 +1963,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
 	builder->state = ondisk.builder.state;
 
 	builder->committed.xcnt = ondisk.builder.committed.xcnt;
+	builder->next_phase_at = ondisk.builder.next_phase_at;
+
 	/* We only allocated/stored xcnt, not xcnt_space xids ! */
 	/* don't overwrite preallocated xip, if we don't have anything here */
 	if (builder->committed.xcnt > 0)
-- 
2.19.1