On Mon, Feb 3, 2025 at 3:40 AM Hayato Kuroda (Fujitsu) <kuroda.hay...@fujitsu.com> wrote: > > Dear Sawada-san, > > > I'm concerned that users could be confused if two different names > > refer to substantially the same thing. > > > > Having said that, I guess that we need to drastically change the > > messages. For example, I think that the wal_level worker should say > > something like "successfully made 'logical' wal_level effective" > > instead of saying something like "changed wal_level value". Also, > > users might not need gradual messages when increasing 'minimal' to > > 'logical' or decreasing 'logical' to 'minimal'. > > +1 for something like "successfully made 'logical' wal_level effective", and > removing gradual messages. > > > > 6. > > > With the patch present, the wal_level can be changed to the minimal even > > > when > > the > > > streaming replication is going. If we do that, the walsender exits > > > immediately > > and > > > the below FATAL appears periodically until the standby stops. Same things > > > can > > be > > > said for the logical replication: > > > > > > ``` > > > FATAL: streaming replication receiver "walreceiver" could not connect to > > > the > > primary server: > > > connection to server on socket "/tmp/.s.PGSQL.oooo" failed: > > > FATAL: WAL senders require "wal_level" to be "replica" or "logical > > > ``` > > > > > > I know this is not a perfect, but can we avoid the issue by reject the > > > GUC update > > > if the walsender exists? Another approach is not to update the value when > > replication > > > slots need to be invalidated. > > > > Does it mean that we reject the config file from being reloaded in > > that case? I have no idea how to reject it in a case where the > > wal_level in postgresql.conf changed and the user did 'pg_ctl reload'. > > I imagined like attached. When I modified wal_level to minimal and send > SIGHUP, > postmaster reported below lines and failed to update wal_level. > > ``` > LOG: received SIGHUP, reloading configuration files > LOG: wal_level cannot be set to "minimal" while walsender exists > LOG: configuration file "...postgresql.conf" contains errors; unaffected > changes were applied > ```
Interesting, and thanks for sharing the patch. But I think that when we change the wal_level to 'minimal', there is a window where a new walsender can launch after passing the check_wal_level() check. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com