Re: "ERROR: deadlock detected" when replicating TRUNCATE

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: "ERROR: deadlock detected" when replicating TRUNCATE
Date: 2021-05-20 06:04:51
Message-ID: CAA4eK1JSP2_g48-T_BbwAyuWXOR5yBuiwTOKsimuNdz53YGN4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 18, 2021 at 6:52 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> >
> > Yeah, have you checked it in the back branches?
> >
>
> Yes, the apply_handle_truncate function was introduced in April/2018 [1].
>
> REL_11_0 was tagged in Oct/2018.
>
> The "ERROR: deadlock detected" log is reproducible in PG 11.0.
>

Okay, I have prepared the patches for all branches (11...HEAD). Each
version needs minor changes in the test, the code doesn't need much
change. Some notable changes in the tests:
1. I have removed the conf change for max_logical_replication_workers
on the publisher node. We only need this for the subscriber node.
2. After creating the new subscriptions wait for initial
synchronization as we do for other tests.
3. synchronous_standby_names need to be reset for the previous test.
This is only required for HEAD.
4. In PG-11, we need to specify the application_name in the connection
string, otherwise, it took the testcase file name as application_name.
This is the same as other tests are doing in PG11.

Can you please once verify the attached patches?

--
With Regards,
Amit Kapila.

Attachment Content-Type Size
v4-0001-Fix-deadlock-for-multiple-replicating-truncates-11.patch application/octet-stream 4.9 KB
v4-0001-Fix-deadlock-for-multiple-replicating-truncates-12.patch application/octet-stream 4.8 KB
v4-0001-Fix-deadlock-for-multiple-replicating-truncates-13.patch application/octet-stream 5.3 KB
v4-0001-Fix-deadlock-for-multiple-replicating-truncates-HEAD.patch application/octet-stream 5.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-05-20 06:07:56 Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set
Previous Message houzj.fnst@fujitsu.com 2021-05-20 05:54:27 RE: Bug in query rewriter - hasModifyingCTE not getting set