diff options
author | Michael Paquier <michael@paquier.xyz> | 2025-10-09 14:02:24 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2025-10-09 14:02:24 +0900 |
commit | 8d02f49696d81b1641412c2f4545403de37faadc (patch) | |
tree | 1fbb146cddd980a00a7daa22071643b1f2943f3f | |
parent | 96b37849734673e7c82fb86c4f0a46a28f500ac8 (diff) |
Remove duplicated log related to slot creation in pg_createsubscriber
The creation of a replication slot done in a specific database on a
publisher was logged twice, with the second log not mentioning the
database where the slot creation happened. This commit removes the
information logged after a slot has been successfully created, moving
the information about the publisher from the second to the first log.
Note that failing a slot creation is also logged, so there is no loss of
information.
Author: Peter Smith <smithpb2250@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAHut+Pv7qDvLbDgc9PQGhULT3rPXTxdu_=w+iW-kMs+zPADR+w@mail.gmail.com
-rw-r--r-- | src/bin/pg_basebackup/pg_createsubscriber.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c b/src/bin/pg_basebackup/pg_createsubscriber.c index 3986882f042..d29407413d9 100644 --- a/src/bin/pg_basebackup/pg_createsubscriber.c +++ b/src/bin/pg_basebackup/pg_createsubscriber.c @@ -801,10 +801,7 @@ setup_publisher(struct LogicalRepInfo *dbinfo) if (lsn) pg_free(lsn); lsn = create_logical_replication_slot(conn, &dbinfo[i]); - if (lsn != NULL || dry_run) - pg_log_info("create replication slot \"%s\" on publisher", - dbinfo[i].replslotname); - else + if (lsn == NULL && !dry_run) exit(1); /* @@ -1375,7 +1372,7 @@ create_logical_replication_slot(PGconn *conn, struct LogicalRepInfo *dbinfo) Assert(conn != NULL); - pg_log_info("creating the replication slot \"%s\" in database \"%s\"", + pg_log_info("creating the replication slot \"%s\" in database \"%s\" on publisher", slot_name, dbinfo->dbname); slot_name_esc = PQescapeLiteral(conn, slot_name, strlen(slot_name)); |