Re: Conflict Detection and Resolution - Mailing list pgsql-hackers

From vignesh C
Subject Re: Conflict Detection and Resolution
Date
Msg-id CALDaNm2PRDH92CP=JwoKATpwHcFNfhVKGutZcB2ds92Ji8U8Zg@mail.gmail.com
Whole thread Raw
In response to Conflict Detection and Resolution  (shveta malik <shveta.malik@gmail.com>)
Responses Re: Conflict Detection and Resolution
Re: Conflict Detection and Resolution
List pgsql-hackers
On Thu, 12 Sept 2024 at 14:03, Ajin Cherian <itsajin@gmail.com> wrote:
>
> On Tue, Sep 3, 2024 at 7:42 PM vignesh C <vignesh21@gmail.com> wrote:
>
>     On Fri, 30 Aug 2024 at 11:01, Nisha Moond <nisha.moond412@gmail.com> wrote:
>     >
>     > Here is the v11 patch-set. Changes are:
>

I was reviewing the CONFLICT RESOLVER (insert_exists='apply_remote')
and found that one conflict remains unresolved in the following
scenario:
Pub:
CREATE TABLE circles(c1 CIRCLE, c2 text, EXCLUDE USING gist (c1 WITH &&));
CREATE PUBLICATION pub1 for table circles;

Sub:
CREATE TABLE circles(c1 CIRCLE, c2 text, EXCLUDE USING gist (c1 WITH &&))
insert into circles values('<(0,0), 5>', 'sub');
CREATE SUBSCRIPTION ... PUBLICATION pub1 CONFLICT RESOLVER
(insert_exists='apply_remote');

The following conflict is not detected and resolved with remote tuple data:
Pub:
INSERT INTO circles VALUES('<(0,0), 5>', 'pub');

 2024-09-19 17:32:36.637 IST [31463] 31463  LOG:  conflict detected on
relation "public.t1": conflict=insert_exists, Resolution=apply_remote.
 2024-09-19 17:32:36.637 IST [31463] 31463  DETAIL:  Key already
exists in unique index "t1_pkey", modified in transaction 742,
applying the remote changes.
Key (c1)=(1); existing local tuple (1, sub); remote tuple (1, pub).
 2024-09-19 17:32:36.637 IST [31463] 31463  CONTEXT:  processing
remote data for replication origin "pg_16398" during message type
"INSERT" for replication target relation "public.t1" in transaction
744, finished at 0/1528E88
........
 2024-09-19 17:32:44.653 IST [31463] 31463  ERROR:  conflicting key
value violates exclusion constraint "circles_c1_excl"
 2024-09-19 17:32:44.653 IST [31463] 31463  DETAIL:  Key
(c1)=(<(0,0),5>) conflicts with existing key (c1)=(<(0,0),5>).
........

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Memory consumed by paths during partitionwise join planning
Next
From: Andrei Lepikhov
Date:
Subject: Re: Memory consumed by paths during partitionwise join planning