Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe87b70

Browse files
committed
Sync process names between ps and pg_stat_activity
Remove gratuitous differences in the process names shown inpg_stat_activity.backend_type and the ps output.Reviewed-by: Takayuki Tsunakawa <tsunakawa.takay@jp.fujitsu.com>
1 parent2c74e6c commitbe87b70

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

‎doc/src/sgml/monitoring.sgml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
<screen>
5050
$ ps auxww | grep ^postgres
5151
postgres 15551 0.0 0.1 57536 7132 pts/0 S 18:02 0:00 postgres -i
52-
postgres 15554 0.0 0.0 57536 1184 ? Ss 18:02 0:00 postgres:writer process
53-
postgres 15555 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: checkpointer process
54-
postgres 15556 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres:wal writer process
55-
postgres 15557 0.0 0.0 58504 2244 ? Ss 18:02 0:00 postgres: autovacuum launcher process
56-
postgres 15558 0.0 0.0 17512 1068 ? Ss 18:02 0:00 postgres: stats collector process
52+
postgres 15554 0.0 0.0 57536 1184 ? Ss 18:02 0:00 postgres:background writer
53+
postgres 15555 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: checkpointer
54+
postgres 15556 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres:walwriter
55+
postgres 15557 0.0 0.0 58504 2244 ? Ss 18:02 0:00 postgres: autovacuum launcher
56+
postgres 15558 0.0 0.0 17512 1068 ? Ss 18:02 0:00 postgres: stats collector
5757
postgres 15582 0.0 0.0 58772 3080 ? Ss 18:04 0:00 postgres: joe runbug 127.0.0.1 idle
5858
postgres 15606 0.0 0.0 58772 3052 ? Ss 18:07 0:00 postgres: tgl regression [local] SELECT waiting
5959
postgres 15610 0.0 0.0 58772 3056 ? Ss 18:07 0:00 postgres: tgl regression [local] idle in transaction
@@ -102,7 +102,7 @@ $ psql -c 'SHOW cluster_name'
102102
(1 row)
103103

104104
$ ps aux|grep server1
105-
postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: server1:writer process
105+
postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: server1:background writer
106106
...
107107
</screen>
108108
</para>

‎src/backend/bootstrap/bootstrap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,19 +321,19 @@ AuxiliaryProcessMain(int argc, char *argv[])
321321
switch (MyAuxProcType)
322322
{
323323
caseStartupProcess:
324-
statmsg="startup process";
324+
statmsg=pgstat_get_backend_desc(B_STARTUP);
325325
break;
326326
caseBgWriterProcess:
327-
statmsg="writer process";
327+
statmsg=pgstat_get_backend_desc(B_BG_WRITER);
328328
break;
329329
caseCheckpointerProcess:
330-
statmsg="checkpointer process";
330+
statmsg=pgstat_get_backend_desc(B_CHECKPOINTER);
331331
break;
332332
caseWalWriterProcess:
333-
statmsg="wal writer process";
333+
statmsg=pgstat_get_backend_desc(B_WAL_WRITER);
334334
break;
335335
caseWalReceiverProcess:
336-
statmsg="wal receiver process";
336+
statmsg=pgstat_get_backend_desc(B_WAL_RECEIVER);
337337
break;
338338
default:
339339
statmsg="??? process";

‎src/backend/postmaster/autovacuum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ AutoVacLauncherMain(int argc, char *argv[])
436436
am_autovacuum_launcher= true;
437437

438438
/* Identify myself via ps */
439-
init_ps_display("autovacuum launcher process","","","");
439+
init_ps_display(pgstat_get_backend_desc(B_AUTOVAC_LAUNCHER),"","","");
440440

441441
ereport(DEBUG1,
442442
(errmsg("autovacuum launcher started")));
@@ -1519,7 +1519,7 @@ AutoVacWorkerMain(int argc, char *argv[])
15191519
am_autovacuum_worker= true;
15201520

15211521
/* Identify myself via ps */
1522-
init_ps_display("autovacuum worker process","","","");
1522+
init_ps_display(pgstat_get_backend_desc(B_AUTOVAC_WORKER),"","","");
15231523

15241524
SetProcessingMode(InitProcessing);
15251525

‎src/backend/postmaster/pgarch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ PgArchiverMain(int argc, char *argv[])
236236
/*
237237
* Identify myself via ps
238238
*/
239-
init_ps_display("archiver process","","","");
239+
init_ps_display("archiver","","","");
240240

241241
pgarch_MainLoop();
242242

‎src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4224,7 +4224,7 @@ PgstatCollectorMain(int argc, char *argv[])
42244224
/*
42254225
* Identify myself via ps
42264226
*/
4227-
init_ps_display("stats collector process","","","");
4227+
init_ps_display("stats collector","","","");
42284228

42294229
/*
42304230
* Read in existing stats files or initialize the stats to zero.

‎src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4266,14 +4266,14 @@ BackendInitialize(Port *port)
42664266
*
42674267
* For a walsender, the ps display is set in the following form:
42684268
*
4269-
* postgres:wal sender process <user> <host> <activity>
4269+
* postgres:walsender <user> <host> <activity>
42704270
*
4271-
* To achieve that, we pass "wal sender process" as username and username
4271+
* To achieve that, we pass "walsender" as username and username
42724272
* as dbname to init_ps_display(). XXX: should add a new variant of
42734273
* init_ps_display() to avoid abusing the parameters like this.
42744274
*/
42754275
if (am_walsender)
4276-
init_ps_display("wal sender process",port->user_name,remote_ps_data,
4276+
init_ps_display(pgstat_get_backend_desc(B_WAL_SENDER),port->user_name,remote_ps_data,
42774277
update_process_title ?"authentication" :"");
42784278
else
42794279
init_ps_display(port->user_name,port->database_name,remote_ps_data,

‎src/backend/postmaster/syslogger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ SysLoggerMain(int argc, char *argv[])
173173

174174
am_syslogger= true;
175175

176-
init_ps_display("logger process","","","");
176+
init_ps_display("logger","","","");
177177

178178
/*
179179
* If we restarted, our stderr is already redirected into our own input

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp