Re: Improve the log message output of basic_archive when basic_archive.archive_directory parameter is not set

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: bt23nguyent <bt23nguyent(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improve the log message output of basic_archive when basic_archive.archive_directory parameter is not set
Date: 2023-09-15 10:49:24
Message-ID: 202309151049.dmfsxc5b3wyf@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-Sep-15, Daniel Gustafsson wrote:

> -basic_archive_configured(ArchiveModuleState *state)
> +basic_archive_configured(ArchiveModuleState *state, const char **errmsg)
>
> The variable name errmsg implies that it will contain the errmsg() data when it
> in fact is used for errhint() data, so it should be named accordingly.
>
> It's probably better to define the interface as ArchiveCheckConfiguredCB
> functions returning an allocated string in the passed pointer which the caller
> is responsible for freeing.

Also note that this callback is documented in archive-modules.sgml, so
that needs to be updated as well. This also means you can't backpatch
this change, or you risk breaking external software that implements this
interface.

I suggest that 'msg' shouldn't be a global variable. There's no need
for that AFAICS; but if there is, this is a terrible name for it.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2023-09-15 11:21:57 Re: pg_upgrade and logical replication
Previous Message Heikki Linnakangas 2023-09-15 10:37:11 Re: Speed up transaction completion faster after many relations are accessed in a transaction