public inbox for [email protected]  
help / color / mirror / Atom feed
From: Zhijie Hou (Fujitsu) <[email protected]>
To: Michail Nikolaev <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: shveta malik <[email protected]>
Cc: Nisha Moond <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: Jan Wieck <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Subject: RE: Conflict detection and logging in logical replication
Date: Mon, 12 Aug 2024 03:33:05 +0000
Message-ID: <OS0PR01MB57166ACCCCD8C4D9FC3FE56294852@OS0PR01MB5716.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CANtu0oiFPkHe0HrbnKKCTXdFKVRfhUF8bwKzR9Y7y3Q7bdQKWQ@mail.gmail.com>
References: <OS3PR01MB5718F4CC16B5549F6D15775194BA2@OS3PR01MB5718.jpnprd01.prod.outlook.com>
	<CANtu0oiFPkHe0HrbnKKCTXdFKVRfhUF8bwKzR9Y7y3Q7bdQKWQ@mail.gmail.com>

On Friday, August 9, 2024 7:45 PM Michail Nikolaev <[email protected]>  wrote:
> There are some comments on this patch related to issue [0]. In short: any
> DirtySnapshot index scan may fail to find an existing tuple in the case of a
> concurrent update.
> 
> - FindConflictTuple may return false negative result in the case of concurrent update because > ExecCheckIndexConstraints uses SnapshotDirty.
> - As a result, CheckAndReportConflict may fail to report the conflict.
> - In apply_handle_update_internal we may get an CT_UPDATE_MISSING instead of CT_UPDATE_DIFFER
> - In apply_handle_update_internal we may get an CT_DELETE_MISSING instead of CT_DELETE_DIFFER
> - In apply_handle_tuple_routing we may get an CT_UPDATE_MISSING instead of CT_UPDATE_DIFFER
> 
> If you're interested, I could create a test to reproduce the issue within the
> context of logical replication. Issue [0] itself includes a test case to
> replicate the problem.
> 
> It also seems possible that a conflict could be resolved by a concurrent update
> before the call to CheckAndReportConflict, which means there's no guarantee
> that the conflict will be reported correctly. Should we be concerned about
> this?

Thanks for reporting.

I think this is an independent issue which can be discussed separately in the
original thread[1], and I have replied to that thread.

Best Regards,
Hou zj


view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: RE: Conflict detection and logging in logical replication
  In-Reply-To: <OS0PR01MB57166ACCCCD8C4D9FC3FE56294852@OS0PR01MB5716.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox