Re: [HACKERS] Why does logical replication launcher set application_name?
От | Magnus Hagander |
---|---|
Тема | Re: [HACKERS] Why does logical replication launcher set application_name? |
Дата | |
Msg-id | CABUevEwdmPgyh41hP0G3OLjCPZHsyfV95Nuwrq8v6dd_NGjUkA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] Why does logical replication launcher setapplication_name? (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>) |
Список | pgsql-hackers |
On Wed, Jun 7, 2017 at 4:58 AM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
On 6/6/17 15:58, Robert Haas wrote:
> The problem with the status quo (after Peter's commit) is that there's
> now nothing at all to identify the logical replication launcher, apart
> from the wait_event field, which is likely to be LogicalLauncherMain
> fairly often if you've got the launcher. I don't personally see why
> we can't simply adopt Tom's original proposal of setting the query
> string to something like "<logical replication launcher>" which, while
> maybe not as elegant as providing some way to override the
> backend_type field, would be almost no work and substantially better
> for v10 than what we've got now.
The decision was made to add background workers to pg_stat_activity, but
no facility was provided to tell the background workers apart. Is it
now the job of every background worker to invent a hack to populate some
other pg_stat_activity field with some ad hoc information? What about
other logical replication worker types, parallel workers, external
background workers, auto-prewarm?
I think the bgw_type addition that I proposed nearby would solve this
quite well, but it needs a bit of work. And arguably, it's too late for
PG10, but one could also argue that this is a design fault in the
pg_stat_activity extension that is valid to fix in PG10.
+1. I definitely think it would be a bad idea to put in what basically looks like a workaround into 10, since the new feature was added there. I'd rather have the fix for pg_stat_activity.
We used to keep our query state as a text field and that was a bad idea for many reasons. So we moved it to a separate field. Let's not repeat that mistake here.
В списке pgsql-hackers по дате отправления: