pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Unify several ways to tracking backend type
2+ messages / 2 participants
[nested] [flat]
* pgsql: Unify several ways to tracking backend type
@ 2020-03-13 13:28 Peter Eisentraut <peter@eisentraut.org>
2020-03-16 19:22 ` Re: pgsql: Unify several ways to tracking backend type Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 2+ messages in thread
From: Peter Eisentraut @ 2020-03-13 13:28 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Unify several ways to tracking backend type
Add a new global variable MyBackendType that uses the same BackendType
enum that was previously only used by the stats collector. That way
several duplicate ways of checking what type a particular process is
can be simplified. Since it's no longer just for stats, move to
miscinit.c and rename existing functions to match the expanded
purpose.
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/c65e5196-4f04-4ead-9353-6088c19615a3@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8e8a0becb335529c66a9f82f88e1419e49b458ae
Modified Files
--------------
src/backend/bootstrap/bootstrap.c | 48 +++++++----------
src/backend/postmaster/autovacuum.c | 8 +--
src/backend/postmaster/bgworker.c | 2 +-
src/backend/postmaster/pgarch.c | 6 +--
src/backend/postmaster/pgstat.c | 105 ++----------------------------------
src/backend/postmaster/postmaster.c | 7 ++-
src/backend/postmaster/syslogger.c | 3 +-
src/backend/utils/adt/pgstatfuncs.c | 2 +-
src/backend/utils/init/miscinit.c | 55 +++++++++++++++++++
src/backend/utils/misc/ps_status.c | 11 +++-
src/include/miscadmin.h | 22 ++++++++
src/include/pgstat.h | 21 +-------
12 files changed, 126 insertions(+), 164 deletions(-)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: pgsql: Unify several ways to tracking backend type
2020-03-13 13:28 pgsql: Unify several ways to tracking backend type Peter Eisentraut <peter@eisentraut.org>
@ 2020-03-16 19:22 ` Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2020-03-16 19:22 UTC (permalink / raw)
To: Peter Eisentraut <peter@eisentraut.org>; +Cc: pgsql-hackers@lists.postgresql.org
On 2020-Mar-13, Peter Eisentraut wrote:
> Unify several ways to tracking backend type
>
> Add a new global variable MyBackendType that uses the same BackendType
> enum that was previously only used by the stats collector. That way
> several duplicate ways of checking what type a particular process is
> can be simplified. Since it's no longer just for stats, move to
> miscinit.c and rename existing functions to match the expanded
> purpose.
Now that I look at this again, I realize that these backend-type
descriptions are not marked translatable, which is at odds with what we
do with HandlChildCrash, for example.
Now, in addition to plastering _() to the strings, maybe we could use
that new function in postmaster.c, say
HandleChildCrash(pid, exitstatus,
GetBackendTypeDesc(B_CHECKPOINTER));
and so on. Same with LogChildExit(). That'd reduce duplication.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-03-16 19:22 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 13:28 pgsql: Unify several ways to tracking backend type Peter Eisentraut <peter@eisentraut.org>
2020-03-16 19:22 ` Alvaro Herrera <alvherre@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox