Re: Non-reserved replication slots and slot advancing
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: michael@paquier.xyz
Cc: alvherre@2ndquadrant.com, andres@anarazel.de,
pgsql-hackers@postgresql.org,
petr@2ndquadrant.com, simon@2ndQuadrant.com
Date: 2018-07-06T06:37:57Z
Lists: pgsql-hackers
Attachments
- doc_edit_pg_create_replication_slot.patch (text/x-patch) patch
At Fri, 6 Jul 2018 14:26:42 +0900, Michael Paquier <michael@paquier.xyz> wrote in <20180706052642.GB776@paquier.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
Commits
-
Block replication slot advance for these not yet reserving WAL
- 9069eb95f48c 11.0 landed
- 56a714721343 12.0 landed