Re: replication_slots usability issue

2018-11-02 Thread Petr Jelinek
On 01/11/2018 18:54, Andres Freund wrote:> >> Also, from 691d79a which you just committed: >> + ereport(FATAL, >> + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), >> +errmsg("logical replication slots \"%s\" exists, but >> wal_level < logical", >> +

Re: replication_slots usability issue

2018-11-01 Thread Michael Paquier
On Thu, Nov 01, 2018 at 10:54:23AM -0700, Andres Freund wrote: > On 2018-11-01 09:34:05 +0900, Michael Paquier wrote: > That has absolutely nothing to do with the issue at hand though, so I > don't think it'd have made much sense to do it at the same time. Nor do > I think it's particularly

Re: replication_slots usability issue

2018-11-01 Thread Andres Freund
On 2018-11-01 09:34:05 +0900, Michael Paquier wrote: > HI Andres, > > On Wed, Oct 31, 2018 at 03:48:02PM -0700, Andres Freund wrote: > > And done. Thanks for the report JD. > > Shouldn't we also switch the PANIC to a FATAL in > RestoreSlotFromDisk()? That has absolutely nothing to do with the

Re: replication_slots usability issue

2018-10-31 Thread Michael Paquier
HI Andres, On Wed, Oct 31, 2018 at 03:48:02PM -0700, Andres Freund wrote: > And done. Thanks for the report JD. Shouldn't we also switch the PANIC to a FATAL in RestoreSlotFromDisk()? I don't mind doing so myself if you agree with the change, only on HEAD as you seemed to disagree about

Re: replication_slots usability issue

2018-10-31 Thread Andres Freund
On 2018-10-30 10:52:54 -0700, Andres Freund wrote: > On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: > > On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > > > I don't think this quite is the problem. ISTM the issue is rather that > > > StartupReplicationSlots() *needs* to check

Re: replication_slots usability issue

2018-10-30 Thread Michael Paquier
On Tue, Oct 30, 2018 at 10:52:54AM -0700, Andres Freund wrote: > On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: >> Er... At the same time, shouldn't RestoreSlotFromDisk() *not* use PANIC >> if more slots are found in pg_replslot than max_replication_slots can >> handle. A FATAL is fine at

Re: replication_slots usability issue

2018-10-30 Thread Andres Freund
On 2018-10-30 11:02:04 -0700, Joshua D. Drake wrote: > On 10/30/18 10:52 AM, Andres Freund wrote: > > On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: > > > On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > > > > I don't think this quite is the problem. ISTM the issue is rather

Re: replication_slots usability issue

2018-10-30 Thread Joshua D. Drake
On 10/30/18 10:52 AM, Andres Freund wrote: On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: I don't think this quite is the problem. ISTM the issue is rather that StartupReplicationSlots() *needs* to check whether wal_level >

Re: replication_slots usability issue

2018-10-30 Thread Andres Freund
On 2018-10-30 11:51:09 +0900, Michael Paquier wrote: > On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > > I don't think this quite is the problem. ISTM the issue is rather that > > StartupReplicationSlots() *needs* to check whether wal_level > minimal, > > and doesn't. So you can

Re: replication_slots usability issue

2018-10-29 Thread Michael Paquier
On Mon, Oct 29, 2018 at 12:13:04PM -0700, Andres Freund wrote: > I don't think this quite is the problem. ISTM the issue is rather that > StartupReplicationSlots() *needs* to check whether wal_level > minimal, > and doesn't. So you can create a slot, shutdown, change wal_level, > startup. A slot

Re: replication_slots usability issue

2018-10-29 Thread Joshua D. Drake
On 10/29/18 11:26 AM, Andres Freund wrote: On October 29, 2018 1:31:56 PM EDT, "Joshua D. Drake" wrote: -Hackers, Working on 9.6 today (unsure if fixed in newer versions). Had an issue where the wal was 280G despite max_wal_size being 8G. Found out there were stale replication slots from a

Re: replication_slots usability issue

2018-10-29 Thread Andres Freund
On 2018-10-29 16:02:18 -0300, Alvaro Herrera wrote: > On 2018-Oct-29, Joshua D. Drake wrote: > > > -Hackers, > > > > > > Working on 9.6 today (unsure if fixed in newer versions). Had an issue where > > the wal was 280G despite max_wal_size being 8G. Found out there were stale > > replication

Re: replication_slots usability issue

2018-10-29 Thread Alvaro Herrera
On 2018-Oct-29, Joshua D. Drake wrote: > -Hackers, > > > Working on 9.6 today (unsure if fixed in newer versions). Had an issue where > the wal was 280G despite max_wal_size being 8G. Found out there were stale > replication slots from a recent base backup. I went to drop the replication >

Re: replication_slots usability issue

2018-10-29 Thread Andres Freund
On October 29, 2018 1:31:56 PM EDT, "Joshua D. Drake" wrote: >-Hackers, > > >Working on 9.6 today (unsure if fixed in newer versions). Had an issue >where the wal was 280G despite max_wal_size being 8G. Found out there >were stale replication slots from a recent base backup. I went to drop

replication_slots usability issue

2018-10-29 Thread Joshua D. Drake
-Hackers, Working on 9.6 today (unsure if fixed in newer versions). Had an issue where the wal was 280G despite max_wal_size being 8G. Found out there were stale replication slots from a recent base backup. I went to drop the replication slots and found that since the wal_level was set to