From: | Petr Jelinek <petr(at)2ndquadrant(dot)com> |
---|---|
To: | Craig Ringer <craig(at)2ndquadrant(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Simon Riggs <simon(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Logical Replication WIP |
Date: | 2016-08-09 09:23:28 |
Message-ID: | 895b30a5-59c5-2f32-ea06-34bfd6d1452c@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 09/08/16 10:13, Craig Ringer wrote:
> On 9 August 2016 at 15:59, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com
> <mailto:sawada(dot)mshk(at)gmail(dot)com>> wrote:
>
>
>
> The logical replication launcher process and the apply process are
> implemented as a bgworker. Isn't better to have them as an auxiliary
> process like checkpointer, wal writer?
>
>
> I don't think so. The checkpointer, walwriter, autovacuum, etc predate
> bgworkers. I strongly suspect that if they were to be implemented now
> they'd use bgworkers.
>
> Now, perhaps we want a new bgworker "kind" for system workers or some
> other minor tweaks. But basically I think bgworkers are exactly what we
> should be using here.
>
Agreed.
>
> IMO the number of logical replication connections should not be
> limited by max_worker_processes.
>
>
> Well, they *are* worker processes... but I take your point, that that
> setting has been "number of bgworkers the user can run" and it might not
> be expected that logical replication would use the same space.
Again agree, I think we should ultimately go towards what PeterE
suggested in
https://www.postgresql.org/message-id/a2fffd92-6e59-a4eb-dd85-c5865ebca1a0@2ndquadrant.com
>
> The only argument I can see for not using bgworkers is for the
> supervisor worker. It's a singleton that launches the per-database
> workers, and arguably is a job that the postmaster could do better. The
> current design there stems from its origins as an extension. Maybe
> worker management could be simplified a bit as a result. I'd really
> rather not invent yet another new and mostly duplicate category of
> custom workers to achieve that though.
>
It is simplified compared to pglogical (there is only 2 worker types not
3). I don't think it's job of postmaster to scan catalogs however so it
can't really start workers for logical replication. I actually modeled
it more after autovacuum (using bgworkers though) than the original
extension.
--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Masahiko Sawada | 2016-08-09 09:28:05 | Re: Logical Replication WIP |
Previous Message | Petr Jelinek | 2016-08-09 09:14:40 | Re: Logical Replication WIP |