Re: [HACKERS] Why does logical replication launcher setapplication_name? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] Why does logical replication launcher setapplication_name?
Date
Msg-id e7451f20-d6e7-4243-14db-e9e90fecb99a@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] Why does logical replication launcher set application_name?  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: [HACKERS] Why does logical replication launcher setapplication_name?
List pgsql-hackers
On 6/2/17 02:31, Masahiko Sawada wrote:
> On Wed, May 31, 2017 at 12:10 PM, Peter Eisentraut
> <peter.eisentraut@2ndquadrant.com> wrote:
>> Here is a proposed solution that splits bgw_name into bgw_type and
>> bgw_name_extra.  bgw_type shows up in pg_stat_activity.backend_type.
>> Uses of application_name are removed, because they are no longer
>> necessary to identity the process type.
> 
> Hmm, is there any reasons why bgw_name_extra string doesn't appear in
> pg_stat_activity?

That's the whole point:  We want to be able to group similar process
types.  The _extra part is particular to a single process, so it might
contain a specific OID or PID it is working on.  The bgw_type is common
for all workers of that kind.

> I'd say current patch makes the user difficult to
> distinguish between apply worker and table sync worker.

We could arguably make apply workers and sync workers have different
bgw_type values.  But if you are interested in that level of detail, you
should perhaps look at pg_stat_subscription.  pg_stat_activity only
contains the "common" data, and the process-specific data is in other views.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Error while creating subscription when server isrunning in single user mode
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Why does logical replication launcher setapplication_name?