v7-0011-BUGFIX-set-final_lsn-for-subxacts-before-cleanup.patch

application/octet-stream

Filename: v7-0011-BUGFIX-set-final_lsn-for-subxacts-before-cleanup.patch
Type: application/octet-stream
Part: 10
Message: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

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 v7-0011
Subject: BUGFIX: set final_lsn for subxacts before cleanup
File+
src/backend/replication/logical/reorderbuffer.c 4 0
From 4bd9c9773941c5b645e793f55d3063d06c9ce7ac Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tv@fuzzy.cz>
Date: Thu, 26 Sep 2019 19:14:45 +0200
Subject: [PATCH v7 11/12] BUGFIX: set final_lsn for subxacts before cleanup

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

diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 16515d0..c0c6a7f 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -1327,6 +1327,10 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
 
 		subtxn = dlist_container(ReorderBufferTXN, node, iter.cur);
 
+		/* make sure subtxn has final_lsn */
+		if (subtxn->final_lsn == InvalidXLogRecPtr)
+			subtxn->final_lsn = txn->final_lsn;
+
 		/*
 		 * Subtransactions are always associated to the toplevel TXN, even if
 		 * they originally were happening inside another subtxn, so we won't
-- 
1.8.3.1