Re: replication slot restart_lsn initialization

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Gurjeet Singh <gurjeet(at)singh(dot)im>, "Duran, Danilo" <danilod(at)amazon(dot)com>, "robertmhaas(at)gmail(dot)com" <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: replication slot restart_lsn initialization
Date: 2015-08-15 12:16:11
Message-ID: CAB7nPqT0Wc1W5mdYGeJ_wbutbwNN+3qgrFR64avXaQCiJMGaYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 14, 2015 at 4:54 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2015-08-14 16:44:44 +0900, Michael Paquier wrote:
>> Commit 6fcd8851, which is the result of this thread, is not touching
>> the replication protocol at all. This looks like an oversight to me:
>> we should be a maximum consistent between the SQL interface and the
>> replication protocol if possible, and it looks useful to me to be able
>> to set restart_lsn when creating the slot as well when using a
>> replication connection.
>
> It wasn't, at least not from my side. You can relatively easily do
> nearly the same just by connecting to the slot and sending a feedback
> message. The complaint upthread (and/or a related thread) was that it's
> not possible to do the same from SQL.
>
> It'd be a good additional to offer the same facility to the replication
> protocol.
> [...]
> I'd name it RESERVE_WAL. My feeling is that the options for the logical
> case are geared towards the output plugin, not the walsender. I think
> it'd be confusing to use (slot_options) differently for physical slots.

Well, this has taken less time than I thought:
=# CREATE_REPLICATION_SLOT toto PHYSICAL;
slot_name | consistent_point | snapshot_name | output_plugin
-----------+------------------+---------------+---------------
toto | 0/0 | null | null
(1 row)
=# CREATE_REPLICATION_SLOT toto2 PHYSICAL RESERVE_WAL;
slot_name | consistent_point | snapshot_name | output_plugin
-----------+------------------+---------------+---------------
toto2 | 0/0 | null | null
(1 row)
=# \q
$ psql -c 'select slot_name,restart_lsn from pg_replication_slots'
slot_name | restart_lsn
-----------+-------------
toto |
toto2 | 0/1738850
(2 rows)

What do you want to do with that? Do you wish to have a look at it or
should I register it in the next CF? I am fine with both, though this
is tightly linked with the feature already committed.
Regards,
--
Michael

Attachment Content-Type Size
20150815_repslot_reserve_wal.patch text/x-diff 4.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2015-08-15 15:55:48 Add support for RADIUS passwords longer than 16 octets
Previous Message David Rowley 2015-08-15 10:45:55 Small improvement to get_base_rel_indexes()