Re: define PG_REPLSLOT_DIR

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: define PG_REPLSLOT_DIR
Date: 2024-08-19 14:13:37
Message-ID: ZsNTEcd0bhfNmTff@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)pg(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-08-19 14:16:01 Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Previous Message Tom Lane 2024-08-19 14:12:43 Re: Improve pg_re_throw: check if sigjmp_buf is valid and report error