On 2015-07-29 09:17:04 +0100, Simon Riggs wrote: > On 29 July 2015 at 09:09, Andres Freund <andres@anarazel.de> wrote: > > The point of using a temporary slot is to not have a > > leftover slot afterwards, reserving resources. Especially important if > > the basebackup actually failed... > > > > Creating a slot and then deleting it if the session disconnects does not > successfully provide the functionality desired above.
Uh? If you create the slot, start streaming, and then start the basebackup, it does. It does *not* guarantee that the base backup can be converted into a replica, but it's sufficient to guarantee it can brought out of recovery.
Perhaps we are misunderstanding the word "it" here. "it can be brought out of recovery"?
You appear to be saying that a backup that disconnects before completion is useful in some way. How so?
If the slot is cleaned up on disconnect, as suggested, then you end up with half a backup and WAL is cleaned up. The only possible use for slots is to reserve resources (as you say); the resources will clearly not be reserved if we drop the slot on disconnect. What use is that?
--
Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services