mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Sync process names between ps and pg_stat_activity
Remove gratuitous differences in the process names shown in pg_stat_activity.backend_type and the ps output. Reviewed-by: Takayuki Tsunakawa <tsunakawa.takay@jp.fujitsu.com>
This commit is contained in:
@ -321,19 +321,19 @@ AuxiliaryProcessMain(int argc, char *argv[])
|
||||
switch (MyAuxProcType)
|
||||
{
|
||||
case StartupProcess:
|
||||
statmsg = "startup process";
|
||||
statmsg = pgstat_get_backend_desc(B_STARTUP);
|
||||
break;
|
||||
case BgWriterProcess:
|
||||
statmsg = "writer process";
|
||||
statmsg = pgstat_get_backend_desc(B_BG_WRITER);
|
||||
break;
|
||||
case CheckpointerProcess:
|
||||
statmsg = "checkpointer process";
|
||||
statmsg = pgstat_get_backend_desc(B_CHECKPOINTER);
|
||||
break;
|
||||
case WalWriterProcess:
|
||||
statmsg = "wal writer process";
|
||||
statmsg = pgstat_get_backend_desc(B_WAL_WRITER);
|
||||
break;
|
||||
case WalReceiverProcess:
|
||||
statmsg = "wal receiver process";
|
||||
statmsg = pgstat_get_backend_desc(B_WAL_RECEIVER);
|
||||
break;
|
||||
default:
|
||||
statmsg = "??? process";
|
||||
|
@ -436,7 +436,7 @@ AutoVacLauncherMain(int argc, char *argv[])
|
||||
am_autovacuum_launcher = true;
|
||||
|
||||
/* Identify myself via ps */
|
||||
init_ps_display("autovacuum launcher process", "", "", "");
|
||||
init_ps_display(pgstat_get_backend_desc(B_AUTOVAC_LAUNCHER), "", "", "");
|
||||
|
||||
ereport(DEBUG1,
|
||||
(errmsg("autovacuum launcher started")));
|
||||
@ -1519,7 +1519,7 @@ AutoVacWorkerMain(int argc, char *argv[])
|
||||
am_autovacuum_worker = true;
|
||||
|
||||
/* Identify myself via ps */
|
||||
init_ps_display("autovacuum worker process", "", "", "");
|
||||
init_ps_display(pgstat_get_backend_desc(B_AUTOVAC_WORKER), "", "", "");
|
||||
|
||||
SetProcessingMode(InitProcessing);
|
||||
|
||||
|
@ -236,7 +236,7 @@ PgArchiverMain(int argc, char *argv[])
|
||||
/*
|
||||
* Identify myself via ps
|
||||
*/
|
||||
init_ps_display("archiver process", "", "", "");
|
||||
init_ps_display("archiver", "", "", "");
|
||||
|
||||
pgarch_MainLoop();
|
||||
|
||||
|
@ -4224,7 +4224,7 @@ PgstatCollectorMain(int argc, char *argv[])
|
||||
/*
|
||||
* Identify myself via ps
|
||||
*/
|
||||
init_ps_display("stats collector process", "", "", "");
|
||||
init_ps_display("stats collector", "", "", "");
|
||||
|
||||
/*
|
||||
* Read in existing stats files or initialize the stats to zero.
|
||||
|
@ -4266,14 +4266,14 @@ BackendInitialize(Port *port)
|
||||
*
|
||||
* For a walsender, the ps display is set in the following form:
|
||||
*
|
||||
* postgres: wal sender process <user> <host> <activity>
|
||||
* postgres: walsender <user> <host> <activity>
|
||||
*
|
||||
* To achieve that, we pass "wal sender process" as username and username
|
||||
* To achieve that, we pass "walsender" as username and username
|
||||
* as dbname to init_ps_display(). XXX: should add a new variant of
|
||||
* init_ps_display() to avoid abusing the parameters like this.
|
||||
*/
|
||||
if (am_walsender)
|
||||
init_ps_display("wal sender process", port->user_name, remote_ps_data,
|
||||
init_ps_display(pgstat_get_backend_desc(B_WAL_SENDER), port->user_name, remote_ps_data,
|
||||
update_process_title ? "authentication" : "");
|
||||
else
|
||||
init_ps_display(port->user_name, port->database_name, remote_ps_data,
|
||||
|
@ -173,7 +173,7 @@ SysLoggerMain(int argc, char *argv[])
|
||||
|
||||
am_syslogger = true;
|
||||
|
||||
init_ps_display("logger process", "", "", "");
|
||||
init_ps_display("logger", "", "", "");
|
||||
|
||||
/*
|
||||
* If we restarted, our stderr is already redirected into our own input
|
||||
|
Reference in New Issue
Block a user