RE: "ERROR: deadlock detected" when replicating TRUNCATE
tanghy.fnst@fujitsu.com <tanghy.fnst@fujitsu.com>
From: "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
To: Amit Kapila <amit.kapila16@gmail.com>, Peter Smith <smithpb2250@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-05-17T09:36:33Z
Lists: pgsql-hackers
Attachments
- v3_test_for_deadlock.patch (application/octet-stream) patch v3
On Monday, May 17, 2021 5:47 PM, Amit Kapila <amit.kapila16@gmail.com> wrote
> +$node_publisher->safe_psql('postgres',
> + "ALTER SYSTEM SET synchronous_standby_names TO 'any 2(sub5_1,
> sub5_2)'");
> +$node_publisher->safe_psql('postgres', "SELECT pg_reload_conf()");
>
> Do you really need these steps to reproduce the problem? IIUC, this
> has nothing to do with synchronous replication.
Agreed.
I tested in asynchronous mode, and could reproduce this problem, too.
The attached patch removed the steps for setting synchronous replication.
And the test passed after applying Peter's patch.
Please take it as your reference.
Regards
Tang
Commits
-
Fix deadlock for multiple replicating truncates of the same table.
- 71787b23e3dc 11.13 landed
- 18c6242b7c6d 12.8 landed
- c83c0257e4c3 13.4 landed
- 6d0eb3855715 14.0 landed
-
Logical replication support for TRUNCATE
- 039eb6e92f20 11.0 cited