public inbox for [email protected]  
help / color / mirror / Atom feed
From: Hayato Kuroda (Fujitsu) <[email protected]>
To: 'Bharath Rupireddy' <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: RE: Add tests for concurrent DML retry paths in logical replication apply
Date: Tue, 28 Apr 2026 07:47:54 +0000
Message-ID: <OS9PR01MB121493EB8A34905A6155EC918F5372@OS9PR01MB12149.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CALj2ACV6ESpggn2Az=OdZBzVx7jiBG9O_EdKdgbk2chAJusC2w@mail.gmail.com>
References: <CALj2ACV6ESpggn2Az=OdZBzVx7jiBG9O_EdKdgbk2chAJusC2w@mail.gmail.com>

Dear Bharath,


> While reading the logical replication apply code in execReplication.c, I noticed
> that the retry paths in RelationFindReplTupleByIndex and RelationFindReplTupleSeq
> for concurrent updates and deletes have no test coverage [1]. Specifically,
> when the same tuple is being updated/deleted on the publisher and subscriber at
> the same time, the dirty snapshot finds the tuple being modified by another
> transaction, the apply worker waits and retries the index/sequential scan.

Good catch.

> The attached patch adds an injection point before table_tuple_lock and a TAP test
> exercising these retry paths, hitting both TM_Updated and TM_Deleted.

I read  the code briefly. Here are questions:

1. 
The test looks like to add the test for retry acquiring the lock. But there is
another retry path, which waits till xwait finishes. Do you have a reason to
skip testing?

2.
Is it OK to use the same injection point name twice? I cannot find the existing
case.

Best regards,
Hayato Kuroda
FUJITSU LIMITED



view thread (3+ messages)  latest in thread

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]
  Subject: RE: Add tests for concurrent DML retry paths in logical replication apply
  In-Reply-To: <OS9PR01MB121493EB8A34905A6155EC918F5372@OS9PR01MB12149.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