v3-0001-Fix-incorrect-cleanup-flag-handling-in-pg_creates.patch
application/octet-stream
Filename: v3-0001-Fix-incorrect-cleanup-flag-handling-in-pg_creates.patch
Type: application/octet-stream
Part: 0
Patch
Format: format-patch
Series: patch v3-0001
Subject: Fix incorrect cleanup flag handling in pg_createsubscriber
| File | + | − |
|---|---|---|
| src/bin/pg_basebackup/pg_createsubscriber.c | 0 | 2 |
From a411e14129ce1b1c6193b7918dc9784ba8d8b8a7 Mon Sep 17 00:00:00 2001 From: Nisha Moond <nisha.moond412@gmail.com> Date: Wed, 1 Apr 2026 13:36:03 +0530 Subject: [PATCH v3] Fix incorrect cleanup flag handling in pg_createsubscriber The flags made_publication and made_replslot track whether the tool created a publication or replication slot on the primary. These are used during error handling to clean up internal objects on primary. Previously, these flags were incorrectly reset to false when failures occurred while dropping objects(publications/replication slots) on the subscriber. As a result, upon a failure, the cleanup_objects_atexit() skipped cleanup of these objects on the primary. This patch removes the resetting of these cleanup flags during drop_replication_slot and drop_publication, ensuring proper cleanup of primary objects before exit on failure. --- src/bin/pg_basebackup/pg_createsubscriber.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c b/src/bin/pg_basebackup/pg_createsubscriber.c index 37631f700af..e1baf198247 100644 --- a/src/bin/pg_basebackup/pg_createsubscriber.c +++ b/src/bin/pg_basebackup/pg_createsubscriber.c @@ -1840,7 +1840,6 @@ drop_replication_slot(PGconn *conn, struct LogicalRepInfo *dbinfo, report_createsub_log(PG_LOG_ERROR, PG_LOG_PRIMARY, "could not drop replication slot \"%s\" in database \"%s\": %s", slot_name, dbinfo->dbname, PQresultErrorMessage(res)); - dbinfo->made_replslot = false; /* don't try again. */ } PQclear(res); @@ -2139,7 +2138,6 @@ drop_publication(PGconn *conn, const char *pubname, const char *dbname, report_createsub_log(PG_LOG_ERROR, PG_LOG_PRIMARY, "could not drop publication \"%s\" in database \"%s\": %s", pubname, dbname, PQresultErrorMessage(res)); - *made_publication = false; /* don't try again. */ /* * Don't disconnect and exit here. This routine is used by primary -- 2.50.1 (Apple Git-155)