On 11/3/16 9:31 AM, Petr Jelinek wrote:
> Release does not really change behavior, it has always dropped ephemeral
> slot.

Well, currently ephemeral is just a temporary state while a slot is
being created.  It's not really something that can exist independently.
You might as well call it RS_NOTREADY.  Therefore, dropping the slot
when you de-acquire (release) it makes sense.

But what you want is a slot that exists across acquire/release but it
dropped at the end of the session.  And what is implicit is that the
slot is only usable by one session, so you don't really need to ever
"release" it for use by other sessions.  And so half the Release calls
have been changed to Release-if-persistent, but it's not explained why
in each case.  It all seems to work OK, but there are a lot of hidden
assumptions in each case that make it hard to follow.

> So if I understand correctly what you are proposing is to change
> behavior of Release to not remove ephemeral slot, add function that
> removes the ephemeral slots of current session and add tracking of
> ephemeral slots created in current session? That seems like quite more
> complicated than what the patch does with little gain.
> 
> What about just releasing the ephemeral slot if the different one is
> being acquired instead of the current error?

Maybe that would help reducing some of the mystery about when you have
to call Release and when ReleasePersistent (better called
ReleaseIfPersistent).

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to