Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: Shubham Khanna <khannashubham1197@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
vignesh C <vignesh21@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-14T04:40:03Z
Lists: pgsql-hackers
Attachments
- PS_show_debug_output.txt (text/plain)
Hi Shubham, In a previous review [1, comment #3] I was complaining about the lack of output emitted by the pg_log_debug() because I wanted to see some LOG evidence of the bad value of max_slot_wal_keep_size. FYI, I think that mystery has finally been solved. AFAIK 2 separate problems were contributing to the lack of debug output. 1. Unlike the 'command_ok' subroutine, the 'command_checks_all' subroutine apparently redirects the output before doing the requested pattern matching on it. So there is no output to be seen. 2. After that, I did not realise the effect of '-verbose' is cumulative on loglevel. Specifically, to see debug messages it is not enough to just say '--verbose'. In fact, you need to specify it 2 times: '--verbose', '--verbose' ~ After addressing these (e.g. by executing the same pg_createsubscriber using 'command_ok' and using a double '--verbose'), the expected LOGS can be seen. e.g. in the file tmp_check/log/regress_log_040_pg_createsubscriber ---------- ... pg_createsubscriber: checking settings on publisher pg_createsubscriber: publisher: wal_level: logical pg_createsubscriber: publisher: max_replication_slots: 10 pg_createsubscriber: publisher: current replication slots: 2 pg_createsubscriber: publisher: max_wal_senders: 10 pg_createsubscriber: publisher: current wal senders: 1 pg_createsubscriber: publisher: max_prepared_transactions: 0 pg_createsubscriber: publisher: max_slot_wal_keep_size: 10485760 pg_createsubscriber: warning: publisher requires WAL size must not be restricted pg_createsubscriber: hint: Set the configuration parameter "max_slot_wal_keep_size" to -1 to ensure that required WAL files are not prematurely removed. pg_createsubscriber: stopping the subscriber ... ---------- See the attached diff for the TAP changes I used to expose this logging. Apply this atop v8. ====== [1] https://www.postgresql.org/message-id/CAHut%2BPszk61QM%2BcEvq_1-A2y%2BJrAD0USB%2BNvtcidajYOfHDkyw%40mail.gmail.com Kind Regards, Peter Smith. Fujitsu Australia
Commits
-
Raise a WARNING for max_slot_wal_keep_size in pg_createsubscriber.
- 217919dd0954 18.0 landed
-
Improve grammar of options for command arrays in TAP tests
- ce1b0f9da03e 18.0 cited