Re: define PG_REPLSLOT_DIR

Поиск
Список
Период
Сортировка
Искать
От
Bertrand Drouvot
Тема
Re: define PG_REPLSLOT_DIR
Дата
Msg-id
ZsNTEcd0bhfNmTff@ip-10-97-1-34.eu-west-3.compute.internal
Ответ на
Список
Дерево обсуждения
define PG_REPLSLOT_DIR Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: define PG_REPLSLOT_DIR Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: define PG_REPLSLOT_DIR Yugo Nagata <nagata@sraoss.co.jp>
Re: define PG_REPLSLOT_DIR Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: define PG_REPLSLOT_DIR Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: define PG_REPLSLOT_DIR Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: define PG_REPLSLOT_DIR Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: define PG_REPLSLOT_DIR Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Re: define PG_REPLSLOT_DIR Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
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  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 по дате отправления
От: Tom Lane
Дата:
От: Robert Haas
Дата:
FAQ