Re: Conflict Detection and Resolution

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(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>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Conflict Detection and Resolution
Date: 2024-10-09 03:28:56
Message-ID: CAJpy0uAEfA9Bhi=8U6dP--Jovj4ZZK88x2upD06xV1eMEAGhxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 8, 2024 at 3:12 PM Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>

I have not started reviewing v15 yet, but here are few comments for
v14-patch003:

1)
In apply_handle_update_internal(), I see that
FindReplTupleInLocalRel() used to lock the row to be updated in
exclusive mode, but now since we are avoiding this call in recursion
and thus the second call onwards, the tuple to be updated or deleted
will not be locked in exclusive mode. You are perhaps locking it
(conflictslot passsed as localslot in recursion) somewhere in
FindConflictTuple in shared mode. Since we are going to delete/update
this tuple, shouldn't it be locked in exclusive mode?

2)
Also, for multiple-key violations case, it would be good to verify the
behavior that when say last update fails for some reason, all the
deleted rows are reverted back? It seems so, but please test once by
forcing the last operation to fail.

thanks
Shveta

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-10-09 03:34:14 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Andrei Lepikhov 2024-10-09 03:15:06 Re: Inconsistent RestrictInfo serial numbers