RE: Replica Identity check of partition table on subscriber - Mailing list pgsql-hackers

From houzj.fnst@fujitsu.com
Subject RE: Replica Identity check of partition table on subscriber
Date
Msg-id OS3PR01MB5718FD1635B5E97FB64AE03B94B29@OS3PR01MB5718.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Replica Identity check of partition table on subscriber  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Replica Identity check of partition table on subscriber
List pgsql-hackers
On Tuesday, June 21, 2022 4:49 PM Amit Kapila <amit.kapila16@gmail.com>
> 
> On Tue, Jun 21, 2022 at 12:50 PM Amit Langote <amitlangote09@gmail.com>
> wrote:
> >
> > On Tue, Jun 21, 2022 at 3:35 PM houzj.fnst@fujitsu.com
> > <houzj.fnst@fujitsu.com> wrote:
> >
> > Attached a patch containing the above to consider as an alternative.
> >
> 
> Thanks, the patch looks good to me. I'll push this after doing some testing.

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));

Best regards,
Hou zj
 

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg15b1: FailedAssertion("val > base", File: "...src/include/utils/relptr.h", Line: 67, PID: 30485)
Next
From: Amit Kapila
Date:
Subject: Re: tablesync copy ignores publication actions