duplicate logging in pg_createsubscriber - Mailing list pgsql-hackers

From Peter Smith
Subject duplicate logging in pg_createsubscriber
Date
Msg-id CAHut+Pv7qDvLbDgc9PQGhULT3rPXTxdu_=w+iW-kMs+zPADR+w@mail.gmail.com
Whole thread Raw
Responses Re: duplicate logging in pg_createsubscriber
Re: duplicate logging in pg_createsubscriber
List pgsql-hackers
Hi hackers,

While reviewing pg_createsubscriber logs (in another thread) I saw
some unexpected (almost) duplicate consecutive logs for the slot
creation in --dry-run mode.

e.g.
----------
pg_createsubscriber: creating the replication slot
"pg_createsubscriber_16386_e9a70df3" in database "db2"
pg_createsubscriber: create replication slot
"pg_createsubscriber_16386_e9a70df3" on publisher
----------

It didn't look right to me.

I found the code is doing:
- pg_log_info("creating the replication slot unconditional inside
create_logical_replication_slot
- pg_log_info("create replication slot...") immediately after call to
create_logical_replication_slot

Perhaps that 2nd log was once supposed to say "created" (past tense),
but even that seemed redundant.

Here is a small patch to remove the log duplication by keeping only
the log *within* the function.

Thoughts?

======
Kind Regards,
Peter Smith.
Fujitsu Asutralia

Attachment

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Add support for specifying tables in pg_createsubscriber.
Next
From: shveta malik
Date:
Subject: Re: Logical Replication of sequences