RE: Replica Identity check of partition table on subscriber
Yu Shi (Fujitsu) <shiy.fnst@fujitsu.com>
From: "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
To: Amit Langote <amitlangote09@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>
Cc: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-06-14T09:01:51Z
Lists: pgsql-hackers
Attachments
- v6-0001-Fix-cache-look-up-failures-while-applying-changes.patch (application/octet-stream) patch v6-0001
- v6-0002-Reset-partition-map-cache-when-receiving-new-rela.patch (application/octet-stream) patch v6-0002
- v6-0003-Check-partition-table-replica-identity-on-subscri.patch (application/octet-stream) patch v6-0003
- v6-0004-fix-memory-leak-about-attrmap.patch (application/octet-stream) patch v6-0004
- v6-pg13-0001-Fix-cache-look-up-failures-while-applying-chang_patch (application/octet-stream)
- v6-pg14-0001-Fix-cache-look-up-failures-while-applying-chang_patch (application/octet-stream)
On Tue, Jun 14, 2022 2:18 PM Amit Langote <amitlangote09@gmail.com> wrote: > > On Mon, Jun 13, 2022 at 9:26 PM Amit Kapila <amit.kapila16@gmail.com> > wrote: > > On Mon, Jun 13, 2022 at 1:03 PM houzj.fnst@fujitsu.com > > <houzj.fnst@fujitsu.com> wrote: > > > On Monday, June 13, 2022 1:53 PM Amit Kapila > <amit.kapila16@gmail.com> wrote: > > > I have separated out the bug-fix for the subscriber-side. > > > And fix the typo and function name. > > > Attach the new version patch set. > > > > > > > The first patch looks good to me. I have slightly modified one of the > > comments and the commit message. I think we need to backpatch this > > through 13 where we introduced support to replicate into partitioned > > tables (commit f1ac27bf). If you guys are fine, I'll push this once > > the work for PG14.4 is done. > > Both the code changes and test cases look good to me. Just a couple > of minor nitpicks with test changes: Thanks for your comments. > > + CREATE UNIQUE INDEX tab5_a_idx ON tab5 (a); > + ALTER TABLE tab5 REPLICA IDENTITY USING INDEX tab5_a_idx; > + ALTER TABLE tab5_1 REPLICA IDENTITY USING INDEX tab5_1_a_idx;}); > > Not sure if we follow it elsewhere, but should we maybe avoid using > the internally generated index name as in the partition's case above? > I saw some existing tests also use internally generated index name (e.g. replica_identity.sql, ddl.sql and 031_column_list.pl), so maybe it's better to fix them all in a separate patch. I didn't change this. > +# Test the case that target table on subscriber is a partitioned table and > +# check that the changes are replicated correctly after changing the schema > of > +# table on subcriber. > > The first sentence makes it sound like the tests that follow are the > first ones in the file where the target table is partitioned, which is > not true, so I think we should drop that part. Also how about being > more specific about the test intent, say: > > Test that replication continues to work correctly after altering the > partition of a partitioned target table. > OK, modified. Attached the new version of patch set, and the patches for pg14 and pg13. Regards, Shi yu
Commits
-
Fix memory leak due to LogicalRepRelMapEntry.attrmap.
- ac0e2d387a04 15.0 landed
- 3238b5c330bc 14.5 landed
- 3a6ef0cdf311 13.8 landed
- 9e0d9a24ef88 12.12 landed
- ed2a7a6bf67d 11.17 landed
- d873b5a5a340 10.22 landed
-
Fix stale values in partition map entries on subscribers.
- 75bfe7434d41 15.0 landed
- f0022a77d011 14.5 landed
- 419c72715172 13.8 landed
-
Fix partition table's REPLICA IDENTITY checking on the subscriber.
- 26b3455afaa9 15.0 landed
- 5f113d60e998 13.8 landed
- 52d5ea9adb01 14.5 landed
-
Fix data inconsistency between publisher and subscriber.
- b7658c24c7c1 15.0 landed
- 0980adfd4d02 14.5 landed
- 1f9a7738eb84 13.8 landed
-
Fix cache look-up failures while applying changes in logical replication.
- 16f5a8da76f2 13.8 landed
- d457cb4e8a5e 14.5 landed
- 5a97b1325453 15.0 landed
-
Add logical replication support to replicate into partitioned tables
- f1ac27bfda6c 13.0 cited