RE: [BUG?] check_exclusion_or_unique_constraint false negative - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: [BUG?] check_exclusion_or_unique_constraint false negative
Date
Msg-id TYAPR01MB56921C9C3D21B0D62FF76330F5B22@TYAPR01MB5692.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: [BUG?] check_exclusion_or_unique_constraint false negative  (Michail Nikolaev <michail.nikolaev@gmail.com>)
Responses Re: [BUG?] check_exclusion_or_unique_constraint false negative
List pgsql-hackers
Dear Michail,

Thanks for pointing out the issue!

>* RelationFindReplTupleByIndex
>
>Amit, this is why I've included you in this previously solo thread :)
>RelationFindReplTupleByIndex uses DirtySnapshot and may not find some records
>if they are updated by a parallel transaction. This could lead to lost
>deletes/updates, especially in the case of streaming=parallel mode. 
>I'm not familiar with how parallel workers apply transactions, so maybe this
>isn't possible.

IIUC, the issue can happen when two concurrent transactions using DirtySnapshot access
the same tuples, which is not specific to the parallel apply. Consider that two
subscriptions exist and publishers modify the same tuple of the same table.
In this case, two workers access the tuple, so one of the changes may be missed
by the scenario you said. I feel we do not need special treatments for parallel
apply.

Best regards,
Hayato Kuroda
FUJITSU LIMITED


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Remove last traces of HPPA support
Next
From: Thomas Munro
Date:
Subject: Re: v17 vs v16 performance comparison