Re: locking [user] catalog tables vs 2pc vs logical rep
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, vignesh C <vignesh21@gmail.com>,
Petr Jelinek <petr.jelinek@enterprisedb.com>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Ajin Cherian <itsajin@gmail.com>, Andres Freund <andres@anarazel.de>,
Pg Hackers <pgsql-hackers@postgresql.org>,
Markus Wanner <markus.wanner@enterprisedb.com>
Date: 2021-05-26T03:27:28Z
Lists: pgsql-hackers
Amit Kapila <amit.kapila16@gmail.com> writes: > Fair enough. But the way we were looking at them as they will also > block (lead to deadlock) for logical replication of prepared > transactions and also logical replication in synchonous mode without > prepared transactions. Now, if we want to deal with the 2PC issues > separately that should be fine as well. However, for that we need to > see which all operations we want to block on [user]_catalog_tables. > The first one is lock command, then there are other operations like > Cluster which take exclusive lock on system catalog tables and we > allow them to be part of prepared transactions (example Cluster > pg_trigger using pg_trigger_oid_index;), another kind of operation is > Truncate on user_catalog_tables. Now, some of these might not allow > connecting after restart so we might need to think whether we want to > prohibit all such operations or only some of them. 2PC has pretty much always worked like that, and AFAIR there have been a grand total of zero complaints about it. It seems quite likely to me that you're proposing to expend a lot of effort on restrictions that will hurt more people than they help. Maybe that score is only about one to zero, but still you should account for the possibility that you're breaking legitimate use-cases. regards, tom lane
Commits
-
Doc: Update caveats in synchronous logical replication.
- 4be39ef9cbc5 9.6.23 landed
- f365151a5392 10.18 landed
- e00e5db22d79 11.13 landed
- a73bd49c69e1 12.8 landed
- 7a4ecefe9d77 13.4 landed
- c66fb78ebb4f 14.0 landed
-
Document a few caveats in synchronous logical replication.
- acdb523cb642 9.6.23 landed
- ff33be61f212 10.18 landed
- 5a456034b84e 11.13 landed
- 9f7bba2629cf 13.4 landed
- eb231dbd80d2 12.8 landed
- 3cb828dbe260 14.0 landed
-
Update the docs and comments for decoding of prepared xacts.
- b4e3dc7fd420 14.0 landed
-
Allow decoding at prepare time in ReorderBuffer.
- a271a1b50e9b 14.0 cited
-
Documentation for logical decoding.
- 49c0864d7ef5 9.4.0 cited