Re: Non-reserved replication slots and slot advancing

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: michael(at)paquier(dot)xyz
Cc: alvherre(at)2ndquadrant(dot)com, andres(at)anarazel(dot)de, pgsql-hackers(at)postgresql(dot)org, petr(at)2ndquadrant(dot)com, simon(at)2ndQuadrant(dot)com
Subject: Re: Non-reserved replication slots and slot advancing
Date: 2018-07-06 06:37:57
Message-ID: 20180706.153757.198773891.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Fri, 6 Jul 2018 14:26:42 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in <20180706052642(dot)GB776(at)paquier(dot)xyz>
> On Fri, Jul 06, 2018 at 01:07:47PM +0900, Kyotaro HORIGUCHI wrote:
> > Form the reasons above, I'd like to vote +1 for just ERRORing
> > in the case.
>
> Thanks for the lookup. Do you have a good idea for the error message to
> provide to users in this case? I would tend to think that "cannot move
> slot which has never been reserved" or "cannot move slot which has never
> been used", particularly the first one, are fine enough, but I am not
> stopped at one single idea in particular either.

Mmm. I feel so much that it's a kind of too much for me, but
FWIW...

I'm not so in favor of the word "reserve" in first place since it
doesn't seem intuitive for me, but "active" is already used for
the state where the connection with the peer is made. (The word
"reserve" may be misused since in the source code "reserve" is
used as "to reserve WAL", but used as "reserve a slot" in
documentation.)

"use", as you mentioned, is neutral but somewhat vague and what
is worse a immediately-reserved slot can be advanced before the
first use.

Most straightforward wording would be:

"ERROR: cannot advance/move slots with invalid restart_lsn"
"HINT: It will have a valid value after the first connection."

Another candidate from me is "initialize". This requires related
documentation fix. (first attached).
# I noticed that the documentation forgets that
# pg_replication_slots now stores two LSNs.

"ERROR: cannot advance/move uninitialized slots"

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
doc_edit_pg_create_replication_slot.patch text/x-patch 2.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2018-07-06 07:09:28 Re: Fix error message when trying to alter statistics on included column
Previous Message Rajkumar Raghuwanshi 2018-07-06 05:51:38 Re: Test patch for partitionwise join with partitioned tables containing default partition