Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-16 Thread Amit Kapila
On Mon, Nov 15, 2021 at 7:20 AM houzj.f...@fujitsu.com wrote: > > On Sat, Nov 13, 2021 6:50 PM Amit Kapila wrote: > > > > The patch looks mostly good to me. I have slightly tweaked the comments in > > the code (as per my previous suggestion) and test. Also, I have slightly > > modified the commit

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-14 Thread houzj.f...@fujitsu.com
On Sat, Nov 13, 2021 6:50 PM Amit Kapila wrote: > > The patch looks mostly good to me. I have slightly tweaked the comments in > the code (as per my previous suggestion) and test. Also, I have slightly > modified the commit message. If the attached looks good to you then kindly > prepare patches

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-13 Thread Amit Kapila
On Sat, Nov 13, 2021 at 12:47 AM Euler Taveira wrote: > > On Fri, Nov 12, 2021, at 3:10 AM, houzj.f...@fujitsu.com wrote: > > On Fri, Nov 12, 2021 1:33 PM Amit Kapila wrote: > > On Fri, Nov 12, 2021 at 10:50 AM Amit Kapila > > wrote: > > > But won't that generate invalidation for the rel twice

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-12 Thread Euler Taveira
On Fri, Nov 12, 2021, at 3:10 AM, houzj.f...@fujitsu.com wrote: > On Fri, Nov 12, 2021 1:33 PM Amit Kapila wrote: > > On Fri, Nov 12, 2021 at 10:50 AM Amit Kapila > > wrote: > > > But won't that generate invalidation for the rel twice in the case > > > (change Replica Identity from Nothing to so

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Fri, Nov 12, 2021 1:33 PM Amit Kapila wrote: > On Fri, Nov 12, 2021 at 10:50 AM Amit Kapila wrote: > > But won't that generate invalidation for the rel twice in the case > > (change Replica Identity from Nothing to some index) you mentioned in > > the previous email? > > > > Oh, I see the poi

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread Amit Kapila
On Fri, Nov 12, 2021 at 10:50 AM Amit Kapila wrote: > > On Fri, Nov 12, 2021 at 10:27 AM houzj.f...@fujitsu.com > wrote: > > > > On Friday, November 12, 2021 10:46 AM I wrote: > > > On Friday, November 12, 2021 8:15 AM Euler Taveira > > > wrote: > > > > I reviewed your patch and I think the fix

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread Amit Kapila
On Fri, Nov 12, 2021 at 10:27 AM houzj.f...@fujitsu.com wrote: > > On Friday, November 12, 2021 10:46 AM I wrote: > > On Friday, November 12, 2021 8:15 AM Euler Taveira > > wrote: > > > I reviewed your patch and I think the fix could be simplified by > > > > > > if (OidIsValid(indexOid)) > > > Ca

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Friday, November 12, 2021 10:46 AM I wrote: > On Friday, November 12, 2021 8:15 AM Euler Taveira > wrote: > > I reviewed your patch and I think the fix could be simplified by > > > > if (OidIsValid(indexOid)) > > CacheInvalidateRelcache(rel); > > > > If indexOid is valid it is a REPLICA IDENTIT

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Friday, November 12, 2021 8:15 AM Euler Taveira wrote: > I reviewed your patch and I think the fix could be simplified by > > if (OidIsValid(indexOid)) > CacheInvalidateRelcache(rel); > > If indexOid is valid it is a REPLICA IDENTITY INDEX. A few lines above there > is > a check for a valid

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread Euler Taveira
On Thu, Nov 11, 2021, at 9:01 AM, houzj.f...@fujitsu.com wrote: > Also attach the patches for back branch and remove some unnecessary > changes from pgindent. I reviewed your patch and I think the fix could be simplified by if (OidIsValid(indexOid)) CacheInvalidateRelcache(rel); If indexOid is va

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Thursday, November 11, 2021 5:36 PM houzj.f...@fujitsu.com wrote: > On Thur, Nov 11, 2021 12:08 PM Amit Kapila wrote: > > On Thu, Nov 11, 2021 at 7:07 AM houzj.f...@fujitsu.com > wrote: > > > > > > On Wed, Nov 10, 2021 7:29 PM Amit Kapila > wrote: > > > > > > > > I don't understand the purpos

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Thur, Nov 11, 2021 12:08 PM Amit Kapila wrote: > On Thu, Nov 11, 2021 at 7:07 AM houzj.f...@fujitsu.com > wrote: > > > > On Wed, Nov 10, 2021 7:29 PM Amit Kapila wrote: > > > > > > I don't understand the purpose of idx_b in the above test case, why is it > > > required to reproduce the probl

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-10 Thread Amit Kapila
On Thu, Nov 11, 2021 at 9:37 AM Amit Kapila wrote: > > On Thu, Nov 11, 2021 at 7:07 AM houzj.f...@fujitsu.com > wrote: > > > > On Wed, Nov 10, 2021 7:29 PM Amit Kapila wrote: > > > > > > I don't understand the purpose of idx_b in the above test case, why is it > > > required to reproduce the pro

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-10 Thread Amit Kapila
On Thu, Nov 11, 2021 at 7:07 AM houzj.f...@fujitsu.com wrote: > > On Wed, Nov 10, 2021 7:29 PM Amit Kapila wrote: > > > > I don't understand the purpose of idx_b in the above test case, why is it > > required to reproduce the problem? > > @@ -15488,6 +15488,7 @@ relation_mark_replica_identity(Rel

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-10 Thread houzj.f...@fujitsu.com
On Wed, Nov 10, 2021 7:29 PM Amit Kapila wrote: > On Wed, Nov 10, 2021 at 12:42 PM tanghy.f...@fujitsu.com > wrote: > > > > Hi > > > > I think I found a bug related to logical replication(REPLICA IDENTITY in > specific). > > If I change REPLICA IDENTITY after creating publication, the > DELETE/U

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-10 Thread Amit Kapila
On Wed, Nov 10, 2021 at 12:42 PM tanghy.f...@fujitsu.com wrote: > > Hi > > I think I found a bug related to logical replication(REPLICA IDENTITY in > specific). > If I change REPLICA IDENTITY after creating publication, the DELETE/UPDATE > operations won't be replicated as expected. > > For exa

[BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-09 Thread tanghy.f...@fujitsu.com
Hi I think I found a bug related to logical replication(REPLICA IDENTITY in specific). If I change REPLICA IDENTITY after creating publication, the DELETE/UPDATE operations won't be replicated as expected. For example: -- publisher CREATE TABLE tbl(a int, b int); ALTER TABLE tbl ALTER COLUMN