minor_fix.diffs

application/octet-stream

Filename: minor_fix.diffs
Type: application/octet-stream
Part: 0
Message: RE: long-standing data loss bug in initial sync of logical replication
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c
index b70091a3c6..ab380c60be 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -489,9 +489,9 @@ RenamePublication(const char *oldname, const char *newname)
 		List	   *schemarelids = NIL;
 
 		/*
-		 * For partition table, when we insert data, get_rel_sync_entry is called and
-		 * a hash entry is created for the corresponding leaf table. So invalidating
-		 * the leaf nodes would be sufficient here.
+		 * For partition table, when we insert data, get_rel_sync_entry is
+		 * called and a hash entry is created for the corresponding leaf table.
+		 * So invalidating the leaf nodes would be sufficient here.
 		 */
 		relids = GetPublicationRelations(pubform->oid,
 										 PUBLICATION_PART_LEAF);
@@ -2013,9 +2013,9 @@ AlterPublicationOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
 		List	   *schemarelids = NIL;
 
 		/*
-		 * For partition table, when we insert data, get_rel_sync_entry is called and
-		 * a hash entry is created for the corresponding leaf table. So invalidating
-		 * the leaf nodes would be sufficient here.
+		 * For partition table, when we insert data, get_rel_sync_entry is
+		 * called and a hash entry is created for the corresponding leaf table.
+		 * So invalidating the leaf nodes would be sufficient here.
 		 */
 		relids = GetPublicationRelations(form->oid,
 										 PUBLICATION_PART_LEAF);
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 1f7c24cad0..d0a5e7d026 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -867,13 +867,15 @@ SnapBuildProcessNewCid(SnapBuild *builder, TransactionId xid,
  * catalog contents).
  */
 static void
-SnapBuildDistributeSnapshotAndInval(SnapBuild *builder, XLogRecPtr lsn, TransactionId xid)
+SnapBuildDistributeSnapshotAndInval(SnapBuild *builder, XLogRecPtr lsn,
+									TransactionId xid)
 {
 	dlist_iter	txn_i;
 	ReorderBufferTXN *txn;
 	ReorderBufferTXN *curr_txn;
 
-	curr_txn = ReorderBufferTXNByXid(builder->reorder, xid, false, NULL, InvalidXLogRecPtr, false);
+	curr_txn = ReorderBufferTXNByXid(builder->reorder, xid, false, NULL,
+									 InvalidXLogRecPtr, false);
 
 	/*
 	 * Iterate through all toplevel transactions. This can include
@@ -923,7 +925,8 @@ SnapBuildDistributeSnapshotAndInval(SnapBuild *builder, XLogRecPtr lsn, Transact
 		 */
 		if (txn->xid != xid && curr_txn->ninvalidations > 0)
 			ReorderBufferAddInvalidations(builder->reorder, txn->xid, lsn,
-										  curr_txn->ninvalidations, curr_txn->invalidations);
+										  curr_txn->ninvalidations,
+										  curr_txn->invalidations);
 	}
 }
 
diff --git a/src/test/subscription/t/100_bugs.pl b/src/test/subscription/t/100_bugs.pl
index c581e28261..72aaaae272 100644
--- a/src/test/subscription/t/100_bugs.pl
+++ b/src/test/subscription/t/100_bugs.pl
@@ -488,8 +488,8 @@ is( $result, qq(2|f
 3|t), 'check replicated update on subscriber');
 
 # Clean up
-$node_publisher->safe_psql('postgres', "DROP  PUBLICATION pub1");
-$node_subscriber->safe_psql('postgres', "DROP  SUBSCRIPTION sub1");
+$node_publisher->safe_psql('postgres', "DROP PUBLICATION pub1");
+$node_subscriber->safe_psql('postgres', "DROP SUBSCRIPTION sub1");
 
 # The bug was that the incremental data synchronization was being skipped when
 # a new table is added to the publication in presence of a concurrent active