Make error messages about WAL segment size more consistent

Started by Peter Eisentrautover 2 years ago3 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

This started out as a small patch to make pg_controldata use the logging
API instead of printf statements, and then it became a larger patch to
adjust error and warning messages about invalid WAL segment sizes
(IsValidWalSegSize()) across the board. I went through and made the
primary messages more compact and made the detail messages uniform. In
initdb.c and pg_resetwal.c, I use the newish option_parse_int() to
simplify some of the option parsing. For the backend GUC
wal_segment_size, I added a GUC check hook to do the verification
instead of coding it in bootstrap.c. This might be overkill, but that
way the check is in the right place and it becomes more self-documenting.

Attachments:

0001-Make-error-messages-about-WAL-segment-size-more-cons.patchtext/plain; charset=UTF-8; name=0001-Make-error-messages-about-WAL-segment-size-more-cons.patchDownload+71-66
#2Aleksander Alekseev
aleksander@timescale.com
In reply to: Peter Eisentraut (#1)
Re: Make error messages about WAL segment size more consistent

Hi Peter,

This started out as a small patch to make pg_controldata use the logging
API instead of printf statements, and then it became a larger patch to
adjust error and warning messages about invalid WAL segment sizes
(IsValidWalSegSize()) across the board.

Thanks for working on this.

I went through and made the
primary messages more compact and made the detail messages uniform. In
initdb.c and pg_resetwal.c, I use the newish option_parse_int() to
simplify some of the option parsing. For the backend GUC
wal_segment_size, I added a GUC check hook to do the verification
instead of coding it in bootstrap.c. This might be overkill, but that
way the check is in the right place and it becomes more self-documenting.

I reviewed the code and tested it on Linux and MacOS with Autotools
and Meson. The patch LGTM.

--
Best regards,
Aleksander Alekseev

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Aleksander Alekseev (#2)
Re: Make error messages about WAL segment size more consistent

On 22.08.23 16:26, Aleksander Alekseev wrote:

Hi Peter,

This started out as a small patch to make pg_controldata use the logging
API instead of printf statements, and then it became a larger patch to
adjust error and warning messages about invalid WAL segment sizes
(IsValidWalSegSize()) across the board.

Thanks for working on this.

I went through and made the
primary messages more compact and made the detail messages uniform. In
initdb.c and pg_resetwal.c, I use the newish option_parse_int() to
simplify some of the option parsing. For the backend GUC
wal_segment_size, I added a GUC check hook to do the verification
instead of coding it in bootstrap.c. This might be overkill, but that
way the check is in the right place and it becomes more self-documenting.

I reviewed the code and tested it on Linux and MacOS with Autotools
and Meson. The patch LGTM.

Thanks, committed.