Re: Replica Identity check of partition table on subscriber
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Date: 2022-06-16T06:13:07Z
Lists: pgsql-hackers
Hi, On Thu, Jun 16, 2022 at 2:07 PM shiy.fnst@fujitsu.com <shiy.fnst@fujitsu.com> wrote: > On Wed, Jun 15, 2022 8:30 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > I have pushed the first bug-fix patch today. > > Attached the remaining patches which are rebased. Thanks. Comments on v9-0001: + * Don't throw any error here just mark the relation entry as not updatable, + * as replica identity is only for updates and deletes but inserts can be + * replicated even without it. I know you're simply copying the old comment, but I think we can rewrite it to be slightly more useful: We just mark the relation entry as not updatable here if the local replica identity is found to be insufficient and leave it to check_relation_updatable() to throw the actual error if needed. + /* Check that replica identity matches. */ + logicalrep_rel_mark_updatable(entry); Maybe the comment (there are 2 instances) should say: Set if the table's replica identity is enough to apply update/delete. Finally, +# Alter REPLICA IDENTITY on subscriber. +# No REPLICA IDENTITY in the partitioned table on subscriber, but what we check +# is the partition, so it works fine. For consistency with other recently added comments, I'd suggest the following wording: Test that replication works correctly as long as the leaf partition has the necessary REPLICA IDENTITY, even though the actual target partitioned table does not. On v9-0002: + /* cleanup the invalid attrmap */ It seems that "invalid" here really means no-longer-useful, so we should use that phrase as a nearby comment does: Release the no-longer-useful attrmap, if any. -- Thanks, Amit Langote EDB: http://www.enterprisedb.com
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