Re: warning to publication created and wal_level is not set tological - Mailing list pgsql-hackers

From David Fetter
Subject Re: warning to publication created and wal_level is not set tological
Date
Msg-id 20190325141533.GA12484@fetter.org
Whole thread Raw
In response to Re: warning to publication created and wal_level is not set to logical  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: warning to publication created and wal_level is not set to logical
List pgsql-hackers
On Sun, Mar 24, 2019 at 02:06:59PM -0400, Tom Lane wrote:
> David Fetter <david@fetter.org> writes:
> > On Thu, Mar 21, 2019 at 07:45:59PM -0300, Lucas Viecelli wrote:
> >> I am sending a patch that when an PUBLICATION is created and the
> >> wal_level is different from logical prints a WARNING in console/log:
> 
> > Is a WARNING sufficient?  Maybe I'm misunderstanding something
> > important, but I think the attempt should fail with a HINT to set the
> > wal_level ahead of time.
> 
> That would be a booby-trap for dump/restore and pg_upgrade, so I don't
> think making CREATE PUBLICATION fail outright would be wise.

I haven't yet come up with a situation where it would be appropriate
both for wal_level to be below logical and for a PUBLICATION to exist,
even as some intermediate state during pg_restore.

> > Possibly in a separate patch, setting the wal_level to anything lower
> > than logical when publications exist should also fail.
> 
> I do not believe this is practical either.  GUC manipulation cannot
> look at the catalogs.

In this case, it really has to do something. Is setting GUCs a path so
critical it can't take one branch?

> I agree that it'd be nice to be noisier about the problem, but I'm
> not sure we can do more than bleat in the postmaster log from time
> to time if a publication is active and wal_level is too low.
> (And we'd better be careful about the log-spam aspect of that...)

With utmost respect, we have a lot more responsibility to the users of
this feature than this might imply. If there are circumstances where
there should be both a PUBLICATION and a wal_level less than logical,
by all means, let's document them very clearly in all the relevant
places.

If, as I strongly suspect, no such circumstance exists, it should not
be possible for someone to have both of those at once, however
inconvenient it is for us to arrange it.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Feature: Add Greek language fulltext search
Next
From: Heikki Linnakangas
Date:
Subject: Re: Usage of epoch in txid_current