Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

From: Shubham Khanna <khannashubham1197(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Smith <smithpb2250(at)gmail(dot)com>
Subject: Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size
Date: 2025-01-09 06:56:07
Message-ID: CAHv8RjJYZFfVgtUiLhoRF-=kWfgDKYamsYni2bNrDBHV_vCuOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 6, 2025 at 7:59 AM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Dear Shubham,
>
> Thanks for creating a patch. I have one comment about it.
>
> check_publisher() assumed that the SQL function `pg_catalog.current_setting('max_slot_wal_keep_size')`
> will return the numeric, but it just return the text representation. I.e., if the parameter is
> set to 10MB, the function returns like below:
>
> ```
> postgres=# SELECT * FROM pg_catalog.current_setting('max_slot_wal_keep_size');
> current_setting
> -----------------
> 10MB
> (1 row)
> ```
>
> Your patch can work well because atoi() ignores the latter part of the string,
> e.g., "10MB" is converted to "10", but this is not clean. I suggest either of
> 1) accepting the value as the string, or 2) using an SQL function pg_size_bytes()
> to get max_slot_wal_keep_size.
>

I have fixed the given comment. The v7 version Patch attached at [1]
has the changes for the same.
[1] - https://www.postgresql.org/message-id/CAHv8Rj%2BSxmBgz-vw5f7meRzEh6pgp9YhAjL5BPzTpevu31rY7Q%40mail.gmail.com

Thanks and regards,
Shubham Khanna.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-01-09 07:05:54 Re: per backend WAL statistics
Previous Message Shubham Khanna 2025-01-09 06:53:10 Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size