RE: Log a warning in pg_createsubscriber for max_slot_wal_keep_size - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Log a warning in pg_createsubscriber for max_slot_wal_keep_size
Date
Msg-id OSCPR01MB149667DB92C3D5D36091338EAF5102@OSCPR01MB14966.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
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.

Best regards,
Hayato Kuroda
FUJITSU LIMITED


pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: Vacuum statistics
Next
From: Amit Kapila
Date:
Subject: Re: Conflict detection for update_deleted in logical replication