pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: yxq@o2.pl
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug?
Date: Tue, 26 Sep 2017 11:56:33 -0400
Message-ID: <20170926155633.GM4628@tamriel.snowman.net> (raw)
In-Reply-To: <11184.1506440634@sss.pgh.pa.us>
References: <14aeb673-fded-e9dd-9e90-f04908f9eadf@2ndquadrant.com>
	<20170822193418.drjntpluvcidfqyf@alap3.anarazel.de>
	<4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com>
	<20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de>
	<020d1ec1-70d6-a4e9-f7f6-ab7eed8f5985@2ndquadrant.com>
	<20170823213949.g7wpurzt6hbi3e5h@alap3.anarazel.de>
	<def3109a-81b6-e6ab-e632-31c34434a90f@2ndquadrant.com>
	<20170925191655.xcn3tsnuibep3jro@alap3.anarazel.de>
	<073783f4-ccf0-65d8-ffa2-01d339958978@2ndquadrant.com>
	<11184.1506440634@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Tom,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> > On 9/25/17 15:16, Andres Freund wrote:
> >> This'll accept tablenames like pg_temp_1foo, right? Might be worth
> >> being a bit narrower in the test.
> 
> > Committed with that change.  Thanks.
> 
> This patch is using the wrong approach entirely.  Every other place in
> the backend that is trying to exclude temp relations uses a test on the
> containing namespace, not the relname.

The specific issue here is that the new pg_class entry is created in the
same namespace, not in the temp one.  The commit mentions make_new_heap()
specifically because that's where the issue is coming from because
that's creating this new pg_temp_XXX table in the regular user
namespace.

I'm not a huge fan of this approach either, really, but I'm not sure
that there's a better answer either.

> I also note that as committed, the patch will dump core on a
> concurrently-dropped relation, because get_rel_name returns NULL
> under such circumstances.

That's certainly no good and should be checked for.

> BTW, get_rel_sync_entry has some other serious problems: it is not being
> at all careful about whether persistent data structures are left in sane
> states if it gets an error partway through.  In particular it'll leave
> behind a new hash entry in entirely-unknown state, and if LoadPublications
> gets an error, it will also leave a time bomb behind in the form of
> not nil, but already-list-freed, data->publications.  And I sure do not
> understand why a single static variable publications_valid is being used
> to remember validity of data->publications ... couldn't there be more
> than one of those?

This all certainly doesn't sound good, but I'm not as familiar with
these bits.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (20+ messages)  latest in thread

Message-ID: <20170926155633.GM4628@tamriel.snowman.net>
Permalink:  ../20170926155633.GM4628@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20170926155633.GM4628@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, andres@anarazel.de, yxq@o2.pl
  Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug?
  In-Reply-To: <20170926155633.GM4628@tamriel.snowman.net>
  References: <14aeb673-fded-e9dd-9e90-f04908f9eadf@2ndquadrant.com> <20170822193418.drjntpluvcidfqyf@alap3.anarazel.de> <4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com> <20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de> <020d1ec1-70d6-a4e9-f7f6-ab7eed8f5985@2ndquadrant.com> <20170823213949.g7wpurzt6hbi3e5h@alap3.anarazel.de> <def3109a-81b6-e6ab-e632-31c34434a90f@2ndquadrant.com> <20170925191655.xcn3tsnuibep3jro@alap3.anarazel.de> <073783f4-ccf0-65d8-ffa2-01d339958978@2ndquadrant.com> <11184.1506440634@sss.pgh.pa.us> <20170926155633.GM4628@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox