Re: define PG_REPLSLOT_DIR
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Yugo Nagata <nagata@sraoss.co.jp>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-08-19T14:13:37Z
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.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
Commits
-
Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder
- c7cd2d6ed082 18.0 landed
-
Define PG_LOGICAL_DIR for path pg_logical/ in data folder
- c39afc38cfec 18.0 landed
-
Define PG_REPLSLOT_DIR for path pg_replslot/ in data folder
- 2065ddf5e34c 18.0 landed