2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.
http://2ndquadrant.com/en/resources/pglogical/
Other
1.01k stars 153 forks source link

pglogical_create_subscriber and non-default ports #282

Open mbanck opened 4 years ago

mbanck commented 4 years ago

pglogical_create_subscriber takes a --publisher-dsn and a --subscriber-dsn option where you can specify non-default ports if needed.

However, it seems to me that pglogical_create_subscriber starts the subscriber postgres on the default port 5432 in pglogical_create_subscriber.c around line 480:

    pg_ctl_ret = run_pg_ctl("start -l \"pglogical_create_subscriber_postgres.log\" -o \"-c shared_preload_libraries=''\"");

Afterwards, I get a 5432 socket in the specified socketdir, the port= from --subscriber-dsn is not being honored.

I can pass a --postgresql-conf where in theory I could change the port, but that one is for the publisher and is getting cloned via pg_basebackup, so if both publisher and subscriber are on the same host (when testing e.g.) that would clash as well.

In particular, the t/010 TAP test seems to require a free 5432 port for the subscriber, which is often not the case on a test system.

As a work-around, I can add local $ENV{PGPORT} = 65432; just before the pglogical_create_subscriber command in the TAP test.

Am I missing something else here maybe?

PJMODOS commented 4 years ago

The --postgresql-conf is not for publisher, it's for the new node.