RE: Check for existing replication slot in pg_createsubscriber - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Check for existing replication slot in pg_createsubscriber
Date
Msg-id OSCPR01MB1496638193FB2705CD34EEC4BF546A@OSCPR01MB14966.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Check for existing replication slot in pg_createsubscriber  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
Dear Amit, Zane,

> Okay, I find your case a good reason to add such a check, apart from
> making the code consistent in terms of these checks. One thing I was
> thinking is whether it makes sense to add these checks only in
> --dry-run mode because we normally don't expect such conflicts.
> Otherwise, each such check adds an additional network round-trip.

I think there are two things which can be checked on the command side. One task is
to see the duplication of names. It can be done by connecting to nodes once and
run SQLs. To avoid the round-trip, this could be added for dry run mode.

Another one is slot-name validation. For now, it completely relies on the publisher
side, but it is better to detect earlier. Currently ReplicationSlotValidateName()
does the validation, and we can move it to under common/ directory to allow
server/client side can use the function. This does very fundamental validation
for the string and may be able to do in both dry run/normal mode.

Best regards,
Hayato Kuroda
FUJITSU LIMITED 


pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages
Next
From: Sami Imseih
Date:
Subject: Re: pg_get_multixact_members not documented