Invalid primary_slot_name triggers warnings in all processes on reload - Mailing list pgsql-hackers

From Fujii Masao
Subject Invalid primary_slot_name triggers warnings in all processes on reload
Date
Msg-id CAHGQGwFud-cvthCTfusBfKHBS6Jj6kdAPTdLWKvP2qjUX6L_wA@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi,

While reviewing the patch at [1], I noticed that if primary_slot_name is
set to an invalid slot name in postgresql.conf and the configuration file
is reloaded, all running postgres processes emit the WARNING message
as follows. Isn't this a bug?

To fix this issue, GUC_check_errmsg() should be used instead of ereport()
when an invalid slot name is found in the setting. Thoughts?

------------------------------------
$ initdb -D data
$ pg_ctl -D data start
$ psql <<EOF
ALTER SYSTEM SET log_line_prefix TO '[%b] ';
SELECT pg_reload_conf();
\! echo "primary_slot_name = 'invalid-'" >> data/postgresql.conf
SELECT pg_reload_conf();
EOF


[postmaster] WARNING:  replication slot name "invalid-" contains
invalid character
[postmaster] HINT:  Replication slot names may only contain lower case
letters, numbers, and the underscore character.
[postmaster] LOG:  invalid value for parameter "primary_slot_name": "invalid-"
[postmaster] LOG:  configuration file
"/System/Volumes/Data/dav/head-pgsql/data/postgresql.conf" contains
errors; unaffected changes were applied
[logical replication launcher] WARNING:  replication slot name
"invalid-" contains invalid character
[logical replication launcher] HINT:  Replication slot names may only
contain lower case letters, numbers, and the underscore character.
[checkpointer] WARNING:  replication slot name "invalid-" contains
invalid character
[checkpointer] HINT:  Replication slot names may only contain lower
case letters, numbers, and the underscore character.
[walwriter] WARNING:  replication slot name "invalid-" contains
invalid character
[walwriter] HINT:  Replication slot names may only contain lower case
letters, numbers, and the underscore character.
hrk:head-pgsql postgres$ [background writer] WARNING:  replication
slot name "invalid-" contains invalid character
[background writer] HINT:  Replication slot names may only contain
lower case letters, numbers, and the underscore character.
[io worker] WARNING:  replication slot name "invalid-" contains
invalid character
[io worker] HINT:  Replication slot names may only contain lower case
letters, numbers, and the underscore character.
[io worker] WARNING:  replication slot name "invalid-" contains
invalid character
[io worker] HINT:  Replication slot names may only contain lower case
letters, numbers, and the underscore character.
[autovacuum launcher] WARNING:  replication slot name "invalid-"
contains invalid character
[autovacuum launcher] HINT:  Replication slot names may only contain
lower case letters, numbers, and the underscore character.
[io worker] WARNING:  replication slot name "invalid-" contains
invalid character
[io worker] HINT:  Replication slot names may only contain lower case
letters, numbers, and the underscore character.
------------------------------------

Regards,

[1] http://postgr.es/m/CANhcyEUUWJ7XBycqFuqQg=eZ_==KT6S7E+rdMy-GE23oLa8tmQ@mail.gmail.com


-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Ashutosh Sharma
Date:
Subject: Re: How can end users know the cause of LR slot sync delays?
Next
From: "Efrain J. Berdecia"
Date:
Subject: Re: New recovery_target_timeline=primary option