Re: Replica Identity check of partition table on subscriber
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Cc: "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Amit Langote <amitlangote09@gmail.com>
Date: 2022-06-23T12:09:19Z
Lists: pgsql-hackers
On Wed, Jun 22, 2022 at 5:05 PM houzj.fnst@fujitsu.com <houzj.fnst@fujitsu.com> wrote: > > On Wednesday, June 22, 2022 7:06 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > On Wed, Jun 22, 2022 at 10:09 AM Amit Langote <amitlangote09@gmail.com> > > wrote: > > > > > > On Wed, Jun 22, 2022 at 12:02 PM houzj.fnst@fujitsu.com > > > <houzj.fnst@fujitsu.com> wrote: > > > > Since the patch has been committed. Attach the last patch to fix the > > memory leak. > > > > > > > > The bug exists on PG10 ~ PG15(HEAD). > > > > > > > > For HEAD,PG14,PG13, to fix the memory leak, I think we should use > > > > free_attrmap instead of pfree and release the no-longer-useful > > > > attrmap When rebuilding the map info. > > > > > > > > For PG12,PG11,PG10, we only need to add the code to release the > > > > no-longer-useful attrmap when rebuilding the map info. We can still > > > > use > > > > pfree() because the attrmap in back-branch is a single array like: > > > > > > > > entry->attrmap = palloc(desc->natts * sizeof(AttrNumber)); > > > > > > LGTM, thank you. > > > > > > > LGTM as well. One thing I am not completely sure about is whether to make this > > change in PG10 for which the final release is in Nov? > > AFAICS, the leak can only occur after the relcache invalidation on the subscriber > > which may or may not be a very frequent case. What do you guys think? > > > > Personally, I feel it is good to fix it in all branches including PG10. > +1 > Pushed! -- With Regards, Amit Kapila.
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