pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15663: set update_process_title =on/off did not take effect
2+ messages / 2 participants
[nested] [flat]

* BUG #15663: set update_process_title =on/off did not take effect
@ 2019-03-02 08:01 PG Bug reporting form <noreply@postgresql.org>
  2019-03-02 16:54 ` Re: BUG #15663: set update_process_title =on/off did not take effect Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2019-03-02 08:01 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: zhq651@126.com

The following bug has been logged on the website:

Bug reference:      15663
Logged by:          DamionZ Zhao
Email address:      zhq651@126.com
PostgreSQL version: 11.1
Operating system:   linux
Description:        

1.before setting
=================
postgres=# \! ps ux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
stream    7978  0.0  0.0 125128  2104 pts/4    S+   13:33   0:00
/data3/damion/stream/run/bin/psql -p 6668 -d postgres -U postgres
stream    7979  0.0  0.0 292452  4840 ?        Ss   13:33   0:00 postgres:
postgres postgres [local] 
stream    8582  0.0  0.0 151028  1848 pts/4    R+   13:33   0:00 ps ux
stream   27385  0.0  0.0 291368 16988 pts/6    S    Mar01   0:01
/data3/damion/stream/run/bin/postgres -D /data3/damion/stream/data
stream   27387  0.0  0.0 291588  4816 ?        Ss   Mar01   0:00 postgres:
checkpointer   
stream   27388  0.0  0.0 291524  2992 ?        Ss   Mar01   0:00 postgres:
background writer   
stream   27389  0.0  0.0 291480  5852 ?        Ss   Mar01   0:00 postgres:
walwriter   
stream   27390  0.0  0.0 291964  2580 ?        Ss   Mar01   0:01 postgres:
autovacuum launcher   
stream   27391  0.0  0.0 141728  1640 ?        Ss   Mar01   0:02 postgres:
stats collector   
stream   27393  0.0  0.0 291792  2336 ?        Ss   Mar01   0:00 postgres:
logical replication launcher   
stream   27426  0.0  0.0 292456  3320 ?        Ss   Mar01   0:00 postgres:
walsender replica *.*.137.152(47426) streaming 0/312F240
postgres=# show update_process_title 
postgres-# ;
 update_process_title 
----------------------
 off
(1 row)

2.begin to set
==============
postgres=# set update_process_title =on;
SET
postgres=# \! pg_ctl reload
server signaled
postgres=# show update_process_title ;
 update_process_title 
----------------------
 on
(1 row)

postgres=# create table t54(f1 int);
CREATE TABLE

3.check ps-title can be updated?
postgres=# \! ps ux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
stream    7978  0.0  0.0 125128  2244 pts/4    S+   13:33   0:00
/data3/damion/stream/run/bin/psql -p 6668 -d postgres -U postgres
stream    7979  0.0  0.0 293072  7424 ?        Ss   13:33   0:00 postgres:
postgres postgres [local] idle
stream   27385  0.0  0.0 291368 16988 pts/6    S    Mar01   0:01
/data3/damion/stream/run/bin/postgres -D /data3/damion/stream/data
stream   27387  0.0  0.0 291588  4816 ?        Ss   Mar01   0:00 postgres:
checkpointer   
stream   27388  0.0  0.0 291524  2996 ?        Ss   Mar01   0:00 postgres:
background writer   
stream   27389  0.0  0.0 291480  5852 ?        Ss   Mar01   0:00 postgres:
walwriter   
stream   27390  0.0  0.0 291964  2580 ?        Ss   Mar01   0:01 postgres:
autovacuum launcher   
stream   27391  0.0  0.0 141728  1640 ?        Ss   Mar01   0:02 postgres:
stats collector    
stream   27393  0.0  0.0 291792  2336 ?        Ss   Mar01   0:00 postgres:
logical replication launcher   
stream   27426  0.0  0.0 292456  3320 ?        Ss   Mar01   0:00 postgres:
walsender replica 100.95.137.152(47426) streaming 0/312F240

lsn is still as before (streaming 0/312F240) in ps-title .

but will be ok, when modify postgres.conf and reload.

I find the following code in guc.c

		{"update_process_title", PGC_SUSET, PROCESS_TITLE,
			gettext_noop("Updates the process title to show the active SQL
command."),
			gettext_noop("Enables updating of the process title every time a new SQL
command is received by the server.")
		},

PGC_SUSET means user can modify it online.  Yes, it's true by showing
update_process_title command.
but did not take effect. so I add debug-log in walsender.c like this:

        /* Report progress of XLOG streaming in PS display */
        if (update_process_title)
        {
                char            activitymsg[50];
                ereport(NOTICE,
                         (errmsg("xxxxxxxx update_process_title is
true.")));
                snprintf(activitymsg, sizeof(activitymsg), "streaming
%X/%X",
                                 (uint32) (sentPtr >> 32), (uint32)
sentPtr);
                set_ps_display(activitymsg, false);
        }
and test it like this
-------------------
postgres=# create table t8(f1 int);
CREATE TABLE
2019-03-02 15:53:36.621 CST [18452] NOTICE:  xxxxxxxx update_process_title
is true.
postgres=# 2019-03-02 15:53:36.800 CST [24102] DEBUG:  autovacuum:
processing database "postgres"

postgres=# 2019-03-02 15:53:38.531 CST [18452] NOTICE:  xxxxxxxx
update_process_title is true.

postgres=# set update_process_title =off;
SET
postgres=# show update_process_title 
postgres-# ;
 update_process_title 
----------------------
 off
(1 row)

postgres=# create table t9(f1 int);
CREATE TABLE
2019-03-02 15:54:00.779 CST [18452] NOTICE:  xxxxxxxx update_process_title
is true.

so not matter update_process_title is off or on,  the global variable
update_process_title value is always true.

Is it reasonable???

4. other test
============
when I modify update_process_title in postgres.conf and  pg_ctl reload.  it
will take effect.
so its behavior is same as PGC_SIGHUP. It's so confusing.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #15663: set update_process_title =on/off did not take effect
  2019-03-02 08:01 BUG #15663: set update_process_title =on/off did not take effect PG Bug reporting form <noreply@postgresql.org>
@ 2019-03-02 16:54 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-03-02 16:54 UTC (permalink / raw)
  To: zhq651@126.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> postgres=# set update_process_title =on;
> SET

That only changes the setting within the current process.  If you want
to change the value that applies in other processes such as a
background walsender, you need to do something else (ALTER SYSTEM
or modify postgresql.conf, and then reload settings).

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-03-02 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02 08:01 BUG #15663: set update_process_title =on/off did not take effect PG Bug reporting form <noreply@postgresql.org>
2019-03-02 16:54 ` Tom Lane <tgl@sss.pgh.pa.us>

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