Re: Conflict Detection and Resolution

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: Ajin Cherian <itsajin(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Jan Wieck <jan(at)wi3ck(dot)info>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Subject: Re: Conflict Detection and Resolution
Date: 2024-07-05 11:42:13
Message-ID: CABdArM6KJ67JKiLcVR5g0gwXHkRrG4t2B3b=-NOrQ65Vog9eTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 1, 2024 at 1:17 PM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
>
>
>
> On Thu, Jun 27, 2024 at 1:14 PM Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>>
>> Please find the attached 'patch0003', which implements conflict
>> resolutions according to the global resolver settings.
>>
>> Summary of Conflict Resolutions Implemented in 'patch0003':
>>
>> INSERT Conflicts:
>> ------------------------
>> 1) Conflict Type: 'insert_exists'
>>
>> Supported Resolutions:
>> a) 'remote_apply': Convert the INSERT to an UPDATE and apply.
>> b) 'keep_local': Ignore the incoming (conflicting) INSERT and retain
>> the local tuple.
>> c) 'error': The apply worker will error out and restart.
>>
>
> Hi Nisha,
>
> While testing the patch, when conflict resolution is configured and insert_exists is set to "remote_apply", I see this warning in the logs due to a resource not being closed:
>
> 2024-07-01 02:52:59.427 EDT [20304] LOG: conflict insert_exists detected on relation "public.test1"
> 2024-07-01 02:52:59.427 EDT [20304] DETAIL: Key already exists. Applying resolution method "remote_apply"
> 2024-07-01 02:52:59.427 EDT [20304] CONTEXT: processing remote data for replication origin "pg_16417" during message type "INSERT" for replication target relation "public.test1" in transaction 763, finished at 0/15E7F68
> 2024-07-01 02:52:59.427 EDT [20304] WARNING: resource was not closed: [138] (rel=base/5/16413, blockNum=0, flags=0x93800000, refcount=1 1)
> 2024-07-01 02:52:59.427 EDT [20304] CONTEXT: processing remote data for replication origin "pg_16417" during message type "COMMIT" in transaction 763, finished at 0/15E7F68
> 2024-07-01 02:52:59.427 EDT [20304] WARNING: resource was not closed: TupleDesc 0x7f8c0439e448 (16402,-1)
> 2024-07-01 02:52:59.427 EDT [20304] CONTEXT: processing remote data for replication origin "pg_16417" during message type "COMMIT" in transaction 763, finished at 0/15E7F68
>
Thank you Ajin for reporting the issue, This is now fixed with the
v4-0003 patch.

--
Thanks,
Nisha

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2024-07-05 11:55:40 Re: Built-in CTYPE provider
Previous Message Dilip Kumar 2024-07-05 11:41:40 Re: Conflict Detection and Resolution