Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLfC5-00012a-Bi for pgsql-pkg-debian@arkaria.postgresql.org; Fri, 25 Sep 2020 04:18:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kLfC4-00054N-9R for pgsql-pkg-debian@arkaria.postgresql.org; Fri, 25 Sep 2020 04:18:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLfC3-00054F-UC for pgsql-pkg-debian@lists.postgresql.org; Fri, 25 Sep 2020 04:18:48 +0000 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kLfC0-0003O7-K3 for pgsql-pkg-debian@postgresql.org; Fri, 25 Sep 2020 04:18:47 +0000 Received: by mail-io1-xd41.google.com with SMTP id r9so1383042ioa.2 for ; Thu, 24 Sep 2020 21:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=bP6jFWlh2kM60scQEn0flzkabpptK+Hz9M8tB6vTD58=; b=YGytxcVUDctn5rvGU2ZiYfX5QJVpa6nyGylMdMASAtPEWxs0zmZl5CidXJqvM7FeVb dm4RnOW4L4VLOYm5Eo47e2WvLDB4OP+TTqI4aM98ZSOEltMoSstg561B4u8MnH+mSB6P FW9eF1zxMJ4Q7eCpYpsY1F1vO0GMHA+4wFZNUq8lL8UEONolEQJgHXeq1nE0995iYoAu 0EM4Rbo/5m8jthy7vQBIm+8mAii0VCyi5jcOiQUBZcQbOnxcqbZgTSJZpCrBm1qTllZD LXBqlgWDNwVnoHX5IIaOLTP5Gay4NBCthp2Aah4FNye43d//6CSdCCmcIaQ0DTVT6bjM m1qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=bP6jFWlh2kM60scQEn0flzkabpptK+Hz9M8tB6vTD58=; b=mxx4I+r381TBQBirg9EHqXY9BRyVxWELL5Uh02LXZ7bpZil8kCrDiI05IOoa2qchHT Wt6Md/w5CrE7WQsGDXMkeQwfRv8CWISIfZzbyzTKHdER7bzlinIpIjwuh8V2+loMWrGu AXjNcY/+Z80lSWj+OcIxip7gL75p2YNhhtitM8x9ydIcPi3Mgm6EnNpN8wSmu1cMqwgn /3gBEPU9iCI+Lp95LGiQHBEzSvz29qBAYHyGtsl2C/msQcE8akevVF/sa59RpmCjQNjR iVhNj/OKiUDSe0O2dpgJZ84Qxdosf2zHt6alXQRWr2ZA3HD5VG2hGDRzkqNHyT90eP/F MDnA== X-Gm-Message-State: AOAM531DVrpfI1cj7WHKDtXWYFzBOdYMzVmDBm5VaJbonB0sjYR0mQv0 hi72XvIPfqdMOjCri3vM0Gp/ZKqw9uzOf8xcV73nQ+mP2qO2Z4C9 X-Google-Smtp-Source: ABdhPJyk/ZErqIldSiACzv8Fxt9c+FbYi88BPTnmPIIhS0I2Y7Ox3cmadqgXlhDPpSZ5BgNlSyOnidRe9X4adghB+Uw= X-Received: by 2002:a5d:8755:: with SMTP id k21mr1955694iol.142.1601007521876; Thu, 24 Sep 2020 21:18:41 -0700 (PDT) MIME-Version: 1.0 From: William Ivanski Date: Fri, 25 Sep 2020 01:18:30 -0300 Message-ID: Subject: Fixed port 65432 in pglogical_create_subscriber To: pgsql-pkg-debian@postgresql.org Content-Type: multipart/alternative; boundary="0000000000009fec7c05b01b9ca8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000009fec7c05b01b9ca8 Content-Type: text/plain; charset="UTF-8" Hi, Operating system is Ubuntu 18.04, the issue is with package postgresql-9.4-pglogical. I didn't test with > 9.4. I've been trying to convert a PostgreSQL 9.4 physical standby into a logical subscriber using pglogical_create_subscriber. It can't initialize pglogical on the subscriber server because it can't connect to the local PostgreSQL database after a restart, so it hangs. As you can see below (sensitive information redacted), I have configured to start local PostgreSQL database on port 5433. File /etc/postgresql/9.4/main/postgresql.conf confirms port is set to 5433. postgres@subserver ~ $ /usr/lib/postgresql/9.4/bin/pglogical_create_subscriber \ > -D /var/lib/postgresql/9.4/main/ -n subserver \ > --subscriber-dsn='host=127.0.0.1 port=5433 dbname=mydb user=pglogical' \ > --provider-dsn='host=192.168.0.100 port=5432 dbname=mydb user=pglogical' \ > --hba-conf=/etc/postgresql/9.4/main/pg_hba.conf \ > --postgresql-conf=/etc/postgresql/9.4/main/postgresql.conf \ > --drop-slot-if-exists -s -v pglogical_create_subscriber: starting ... Getting information for database mydb ... Creating replication slot in database mydb ... Creating restore point "pglogical_create_subscriber_59e1d7bc" on remote node ... Bringing subscriber node to the restore point ... Waiting for PostgreSQL to accept connections .... Waiting for PostgreSQL to become primary...Waiting for PostgreSQL to accept connections ... Removing old pglogical configuration ... Waiting for PostgreSQL to shutdown ... Initializing pglogical on the subscriber node: Waiting for PostgreSQL to accept connections ................[never ends] pglogical_create_subscriber started the local PostgreSQL instance on port 65432, but it's expecting to connect to port 5433, so it will never be able to connect. I checked pglogical source code on [1] and I was not able to find any explanation for this fixed port 65432. Then I found the pglogical source code is being patched to start Postgres with a fixed port 65432 here [2]. [1] https://github.com/2ndQuadrant/pglogical [2] https://salsa.debian.org/postgresql/pglogical/-/blob/master/debian/patches/pglogical_create_subscriber_set_port.patch -- William Ivanski - 2ndQuadrant PostgreSQL Solutions for the Enterprise --0000000000009fec7c05b01b9ca8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Operating system is Ubun= tu 18.04, the issue is with package postgresql-9.4-pglogical. I didn't = test with > 9.4.

I've been trying to conver= t a PostgreSQL 9.4 physical standby into a logical subscriber using pglogic= al_create_subscriber. It can't initialize pglogical on the subscriber s= erver because it can't connect to the local PostgreSQL database after a= restart, so it hangs.

As you can see below (sensi= tive information redacted), I have configured to start local PostgreSQL dat= abase on port 5433. File /etc/postgresql/9.4/main/postgresql.conf confirms = port is set to 5433.


postgres@subse= rver ~ $ /usr/lib/postgresql/9.4/bin/pglogical_create_subscriber \
> = =C2=A0-D /var/lib/postgresql/9.4/main/ -n subserver \
> =C2=A0--subsc= riber-dsn=3D'host=3D127.0.0.1 port=3D5433 dbname=3Dmydb user=3Dpglogica= l' \
> =C2=A0--provider-dsn=3D'host=3D192.168.0.100 port=3D54= 32 dbname=3Dmydb user=3Dpglogical' \
> =C2=A0--hba-conf=3D/etc/po= stgresql/9.4/main/pg_hba.conf \
> =C2=A0--postgresql-conf=3D/etc/post= gresql/9.4/main/postgresql.conf \
> =C2=A0--drop-slot-if-exists -s -v=
pglogical_create_subscriber: starting ...
Getting information for da= tabase mydb ...
Creating replication slot in database mydb ...
Creati= ng restore point "pglogical_create_subscriber_59e1d7bc" on remote= node ...
Bringing subscriber node to the restore point ...
Waiting f= or PostgreSQL to accept connections ....
Waiting for PostgreSQL to becom= e primary...Waiting for PostgreSQL to accept connections ...

Removin= g old pglogical configuration ...
Waiting for PostgreSQL to shutdown ...=
Initializing pglogical on the subscriber node:
Waiting for PostgreSQ= L to accept connections ................[never ends]


pglogical_create_subscriber started the local Postgre= SQL instance on port 65432, but it's expecting to connect to port 5433,= so it will never be able to connect.

I checked pg= logical source code on [1] and I was not able to find any explanation for t= his fixed port 65432. Then I found the pglogical source code is being patch= ed to start Postgres with a fixed port 65432 here [2].

=


--
William Ivanski - 2ndQuadrant
PostgreSQL Solutions for the Enterprise
--0000000000009fec7c05b01b9ca8--