From: | Peter Smith <smithpb2250(at)gmail(dot)com> |
---|---|
To: | Shubham Khanna <khannashubham1197(at)gmail(dot)com> |
Cc: | vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size |
Date: | 2025-01-03 02:36:21 |
Message-ID: | CAHut+PsUHKwq+jAkn-7Ks=3N0r4ue+1XhRhy6dBnD7HqXGcxnA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Shubham,
Here are some review comments for patch v5-0001.
======
doc/src/sgml/ref/pg_createsubscriber.sgml
1.
+ <para>
+ The source server must have <xref linkend="guc-max-slot-wal-keep-size"/> to
+ be set to <literal>-1</literal> to prevent the automatic removal of WAL
+ replication slots. Setting this parameter to files needed by a
specific size
+ may lead to replication failures if required WAL files are
+ prematurely deleted.
+ </para>
IIUC, this problem is all about the removal of WAL *files*, not "WAL
replication slots".
Also, the "Setting this parameter to files needed by a specific size"
part sounds strange.
I think this can be simplified anyhow like below.
SUGGESTION:
Replication failures can occur if required WAL files are prematurely
deleted. To prevent this, the source server must set <xref
linkend="guc-max-slot-wal-keep-size"/> to <literal>-1</literal>,
ensuring WAL files are not automatically removed.
======
src/bin/pg_basebackup/pg_createsubscriber.c
check_publisher:
2.
+ if (dry_run && max_slot_wal_keep_size != -1)
+ {
+ pg_log_warning("publisher requires WAL size must not be restricted");
+ pg_log_warning_detail("The max_slot_wal_keep_size parameter is
currently set to a non-default value, which may lead to replication
failures. "
+ "This parameter must be set to -1 to ensure that required WAL
files are not prematurely removed.");
+ }
2a.
Whenever you mention a GUC name in a PostgreSQL message then (by
convention) it must be double-quoted.
~
2b.
The detailed message seems verbose and repetitive to me.
~
2c.
The other nearby messages use the terminology "configuration
parameter", so this should be the same.
~
2d.
The other nearby messages use \"%s\" substitution for the GUC name, so
this should be the same.
~
2e.
IMO advising the user to change a configuration parameter should be
done using the pg_log_warning_hint function (e.g. _hint, not
_details).
~~
Result:
CURRENT (pg_log_warning_details)
The max_slot_wal_keep_size parameter is currently set to a non-default
value, which may lead to replication failures. This parameter must be
set to -1 to ensure that required WAL files are not prematurely
removed.
SUGGESTION (pg_log_warning_hint)
Set the configuration parameter \"%s\" to -1 to ensure that required
WAL files are not prematurely removed.
======
Kind Regards,
Peter Smith.
Fujitsu Australia
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2025-01-03 03:21:12 | Re: Add the ability to limit the amount of memory that can be allocated to backends. |
Previous Message | Tom Lane | 2025-01-03 01:58:01 | Re: Fwd: Re: A new look at old NFS readdir() problems? |