Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwsDv-0007fl-9C for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Sep 2017 15:56:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dwsDu-0005CI-SN for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Sep 2017 15:56:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dwsDt-00058B-QM for pgsql-bugs@postgresql.org; Tue, 26 Sep 2017 15:56:37 +0000 Received: from static-96-255-250-162.washdc.fios.verizon.net ([96.255.250.162] helo=tamriel.snowman.net) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwsDr-00008j-1I for pgsql-bugs@postgresql.org; Tue, 26 Sep 2017 15:56:36 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 7C4515F795; Tue, 26 Sep 2017 11:56:33 -0400 (EDT) Date: Tue, 26 Sep 2017 11:56:33 -0400 From: Stephen Frost To: Tom Lane Cc: Peter Eisentraut , Andres Freund , yxq@o2.pl, pgsql-bugs@postgresql.org Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug? Message-ID: <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> <20170925191655.xcn3tsnuibep3jro@alap3.anarazel.de> <073783f4-ccf0-65d8-ffa2-01d339958978@2ndquadrant.com> <11184.1506440634@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wRQTDerXn2dy7dTI" Content-Disposition: inline In-Reply-To: <11184.1506440634@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --wRQTDerXn2dy7dTI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Tom, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Peter Eisentraut 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. >=20 > > Committed with that change. Thanks. >=20 > 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 --wRQTDerXn2dy7dTI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJZynixAAoJEO1sijiDR2RVUSoQAJ+FM2XswP3BwRBy7hWjTt5W Oh+QugrLel37FoHTv+TZkTSvjNSj2PrSGNikR97KUpiSxxV1VOC5Pwt/wpu7Tiea 8CzCzh2Hgw09+310nHI3G2euauS35QPDG77pfr0iL6JRLAwK44pL9gFBK2Mmup6g JSNWgVxclLb3BFK/HkVmOLgBkOMlT/P+TxwAxaKjho5kzM/UzprKXqGY6MqAjRW+ NKLR7XKdWk1vfVxmGaiSiKa3vLP3crc/Ha7aSJ1iNTVnfpcZR893VSsgBD2xXeze G4fRt+VRsZdfUSP9b1BdXuMny49PWDR6O7SJgOUeHoLdH1P9b1aesUXuEY95VseW /ExtDTymBCFXoZHYOISzDW9X/kBkIOx3I8i7Z3Re7511VF+VvMqbOBActnX1Vnc2 aMB9GtcgW1fuiShiHSdPAvNS3fRj2h1EsUEl5o6xskJ9Jry4fsqlpt/r2rTDjIwZ f1MJhXv3AIZ7Bedrd3j19wOvS157BkaM1K2RXT074Jh7A3Rr3KiKER5AjIzP3b4l vBY8zcWhd0GFf2LiYtFV+BFard5bScRiuQW2f4Bahuw9bd0AglGCJactGxo1KTDc 3hZCCtE8Ebr5leuaRLZ8Bd0yKD6p+m7znJDjPnmE7/InC/OI4YH4K3NrpzQFPdIP cuQeyuyYPD4gmXFKXG+3 =UApc -----END PGP SIGNATURE----- --wRQTDerXn2dy7dTI--