Re: Non-superuser subscription owners
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>,
Jeff Davis <pgsql@j-davis.com>, Andrew Dunstan <andrew@dunslane.net>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-12-10T14:09:26Z
Lists: pgsql-hackers
On Thu, Dec 9, 2021 at 11:15 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > Yeah, to me also (b) sounds better than (a). However, a few points > that we might want to consider in that regard are as follows: 1. > locking the subscription for each transaction will add new blocking > areas considering we acquire AccessExclusiveLock to change any > property of subscription. But as Alter Subscription won't be that > frequent operation it might be acceptable. The problem isn't the cost of the locks taken by ALTER SUBSCRIPTION. It's the cost of locking and unlocking the relation for every transaction we apply. Suppose it's a pgbench-type workload with a single UPDATE per transaction. You've just limited the maximum possible apply speed to about, I think, 30,000 transactions per second no matter how many parallel workers you use, because that's how fast the lock manager is (or was, unless newer hardware or newer PG versions have changed things in a way I don't know about). That seems like a poor idea. There's nothing wrong with noticing changes at the next transaction boundary, as long as we document it. So why would we incur a possibly-significant performance cost to provide a stricter guarantee? I bet users wouldn't even like this behavior. It would mean that if you are replicating a long-running transaction, an ALTER SUBSCRIPTION command might block for a long time until replication of that transaction completes. I have a hard time understanding why anyone would consider that an improvement. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix possible crash in tablesync worker.
- b5c517379a40 16.0 landed
-
Display 'password_required' option for \dRs+ command.
- 19e65dff38bd 16.0 landed
-
Restart the apply worker if the 'password_required' option is changed.
- c1cc4e688b60 16.0 landed
-
Fix possible logical replication crash.
- e7e7da2f8d57 16.0 landed
-
Add new predefined role pg_create_subscription.
- c3afe8cf5a1e 16.0 landed
-
Expand AclMode to 64 bits
- 7b378237aa80 16.0 cited
-
More cleanup of a2ab9c06ea.
- 96a6f11c0625 15.0 landed
-
Respect permissions within logical replication.
- a2ab9c06ea15 15.0 landed
-
Improve table locking behavior in the face of current DDL.
- 2ad36c4e44c8 9.2.0 cited