Re: exposing wait events for non-backends (was: Tracking wait event for latches)

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Kevin Grittner <kgrittn(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: exposing wait events for non-backends (was: Tracking wait event for latches)
Date: 2017-03-07 10:54:48
Message-ID: 0cbd9ca6-c982-2a5c-f22b-3a11e5ae2405@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kuntal,

Patches apply and compile fine. Works as advertised.

Some minor comments on the patches themselves.

In 0001:

- * pgstat_bestart() -
+ * pgstat_procstart() -
+ *
+ * Initialize this process's entry in the PgBackendStatus array.
+ * Called from InitPostgres and AuxiliaryProcessMain.

Not being called from AuxiliaryProcessMain(). Maybe leftover comment from
a previous version. Actually I see that in patch 0002, Main() functions
of various auxiliary processes call pgstat_procstart, not
AuxiliaryProcessMain.

+ * user-defined functions which expects ids of backends starting from
1 to

s/expects/expect/g

+/*
+ * AuxiliaryPidGetProc -- get PGPROC for an auxiliary process
+ * given its PID
+ *
+ * Returns NULL if not found.
+ */
+PGPROC *
+AuxiliaryPidGetProc(int pid)
+{
+ PGPROC *result;

Initialize to NULL so that the comment above is true. :)

In 0002:

@@ -248,6 +248,9 @@ BackgroundWriterMain(void)
*/
prev_hibernate = false;

+ /* report walwriter process in the PgBackendStatus array */
+ pgstat_procstart();
+

s/walwriter/writer/g

Patch 0004 should update monitoring.sgml.

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2017-03-07 10:55:58 Re: Two phase commit in ECPG
Previous Message Simon Riggs 2017-03-07 10:20:00 Re: Patch to improve performance of replay of AccessExclusiveLock