Re: Why does logical replication launcher set application_name?

From: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does logical replication launcher set application_name?
Date: 2017-06-03 07:32:59
Message-ID: CAGz5QCKN=XaB3mFget=GP3DH+-6+tBmJ2Gk-Qpt2OxY=mcy2Hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 3, 2017 at 8:53 AM, Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
> On 6/2/17 15:08, Peter Eisentraut wrote:
>> On 5/30/17 23:10, Peter Eisentraut 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.
>>>
>>> This code appears to be buggy because I sometimes get NULL results of
>>> the backend_type lookup, implying that it couldn't find the background
>>> worker slot. This needs another look.
>>
AFAICU, when we register a background worker using
RegisterDynamicBackgroundWorker, it's not included in
BackgroundWorkerList(which is postmaster's list of registered
background workers, in private memory). Instead, we use only
BackgroundWorkerSlots. Perhaps, this is the reason that backend_type
is NULL for parallel workers.

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kuntal Ghosh 2017-06-03 07:33:20 Re: Why does logical replication launcher set application_name?
Previous Message Mengxing Liu 2017-06-03 06:51:54 Re: Re: [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions