record_transaction_commmit-v2.patch

application/octet-stream

Filename: record_transaction_commmit-v2.patch
Type: application/octet-stream
Part: 0
Message: Re: RecordTransactionCommit() and SharedInvalidationMessages

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: unified
Series: patch v2
File+
src/backend/access/transam/xact.c 5 4
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 511aba2..503c722 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -915,15 +915,16 @@ RecordTransactionCommit(void)
 	bool		haveNonTemp;
 	int			nchildren;
 	TransactionId *children;
-	int			nmsgs;
+	int			nmsgs = 0;
 	SharedInvalidationMessage *invalMessages = NULL;
-	bool		RelcacheInitFileInval;
+	bool		RelcacheInitFileInval = false;
 
 	/* Get data needed for commit record */
 	nrels = smgrGetPendingDeletes(true, &rels, &haveNonTemp);
 	nchildren = xactGetCommittedChildren(&children);
-	nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
-												 &RelcacheInitFileInval);
+	if (XLogStandbyInfoActive())
+		nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
+													 &RelcacheInitFileInval);
 
 	/*
 	 * If we haven't been assigned an XID yet, we neither can, nor do we want