Re: [HACKERS] logical replication worker and statistics - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] logical replication worker and statistics
Date
Msg-id 4b337a8f-121c-6666-c895-55b0aa9d0964@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] logical replication worker and statistics  (Stas Kelvich <s.kelvich@postgrespro.ru>)
Responses Re: [HACKERS] logical replication worker and statistics  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
List pgsql-hackers
On 4/10/17 13:06, Stas Kelvich wrote:
> 
>> On 10 Apr 2017, at 19:50, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
>>
>> On 4/10/17 05:49, Stas Kelvich wrote:
>>> Here is small patch to call statistics in logical worker. Originally i thought that stat
>>> collection during logical replication should manually account amounts of changed tuples,
>>> but seems that it is already smoothly handled on relation level. So call to 
>>> pgstat_report_stat() is enough.
>>
>> I wonder whether we need a similar call somewhere in tablesync.c.  It
>> seems to work without it, though.
> 
> I thought it spins up the same worker from worker.c.

It depends on which of the various tablesync scenarios happens.  If the
apply lags behind the tablesync, then the apply doesn't process commit
messages until it has caught up.  So the part of the code you patched
wouldn't be called.

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] error handling in RegisterBackgroundWorker
Next
From: Noah Misch
Date:
Subject: Re: [HACKERS] SUBSCRIPTIONS and pg_upgrade