Re: define PG_REPLSLOT_DIR - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: define PG_REPLSLOT_DIR
Date
Msg-id ZsNTEcd0bhfNmTff@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: define PG_REPLSLOT_DIR  (Yugo Nagata <nagata@sraoss.co.jp>)
List pgsql-hackers
Hi,

On Fri, Aug 16, 2024 at 01:31:11PM +0900, Yugo Nagata wrote:
> On Wed, 14 Aug 2024 11:32:14 +0000
> Bertrand Drouvot <bertranddrouvot.pg@gmail.com> wrote:
> > Looking forward to your feedback,
> 
>     /* restore all slots by iterating over all on-disk entries */
> -   replication_dir = AllocateDir("pg_replslot");
> -   while ((replication_de = ReadDir(replication_dir, "pg_replslot")) != NULL)
> +   replication_dir = AllocateDir(PG_REPLSLOT_DIR);
> +   while ((replication_de = ReadDir(replication_dir, PG_REPLSLOT_DIR)) != NULL)
>     {
>         char        path[MAXPGPATH + 12];
>         PGFileType  de_type;
> 
> I think the size of path can be rewritten to "MAXPGPATH + sizeof(PG_REPLSLOT_DIR)" 
> and it seems easier to understand the reason why this size is used. 

Thanks for the feedback!

Yeah, fully agree, it has been done that way in v2 that I just shared up-thread.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Improve pg_re_throw: check if sigjmp_buf is valid and report error
Next
From: Robert Haas
Date:
Subject: Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs