Re: Identify missing publications from publisher while create/alter subscription.

Поиск
Список
Период
Сортировка
От Euler Taveira
Тема Re: Identify missing publications from publisher while create/alter subscription.
Дата
Msg-id ed6209f3-378b-45bc-9009-e6bb95e656ba@www.fastmail.com
обсуждение исходный текст
Ответ на Re: Identify missing publications from publisher while create/alter subscription.  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Ответы Re: Identify missing publications from publisher while create/alter subscription.  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Список pgsql-hackers
On Wed, Feb 9, 2022, at 12:06 PM, Ashutosh Sharma wrote:
Just wondering if we should also be detecting the incorrect conninfo
set with ALTER SUBSCRIPTION command as well. See below:

-- try creating a subscription with incorrect conninfo. the command fails.
postgres=# create subscription sub1 connection 'host=localhost
port=5490 dbname=postgres' publication pub1;
ERROR:  could not connect to the publisher: connection to server at
"localhost" (::1), port 5490 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5490 failed:
Connection refused
    Is the server running on that host and accepting TCP/IP connections?
That's because by default 'connect' parameter is true.

The important routine for all SUBSCRIPTION commands that handle connection
string is to validate the connection string e.g. check if all parameters are
correct. See walrcv_check_conninfo that calls PQconninfoParse.

The connection string is syntactically correct. Hence, no error. It could be
the case that the service is temporarily down. It is a useful and common
scenario that I wouldn't want to be forbid.

-- reset the connninfo in the subscription to some wrong value. the
command succeeds.
postgres=# alter subscription sub1 connection 'host=localhost
port=5490 dbname=postgres';
ALTER SUBSCRIPTION
postgres=#

postgres=# drop subscription sub1;
ERROR:  could not connect to publisher when attempting to drop
replication slot "sub1": connection to server at "localhost" (::1),
port 5490 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5490 failed:
Connection refused
    Is the server running on that host and accepting TCP/IP connections?
HINT:  Use ALTER SUBSCRIPTION ... SET (slot_name = NONE) to
disassociate the subscription from the slot.
Again, dropping a subscription that is associated with a replication slot
requires a connection to remove the replication slot. If the publisher is gone
(and so the replication slot), follow the HINT advice.


--
Euler Taveira

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: Unnecessary call to resetPQExpBuffer in getIndexes
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints