Re: pg_check_dir comments and implementation mismatch

Поиск
Список
Период
Сортировка
От Marco Nenciarini
Тема Re: pg_check_dir comments and implementation mismatch
Дата
Msg-id 54CA74D4.2000409@2ndquadrant.it
обсуждение исходный текст
Ответ на Re: pg_check_dir comments and implementation mismatch  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Il 29/01/15 18:37, Robert Haas ha scritto:
> On Thu, Jan 29, 2015 at 11:00 AM, Marco Nenciarini
> <marco.nenciarini@2ndquadrant.it> wrote:
>> reading pgcheckdir.c code I noticed that the function comment
>> was outdated. The code now can return values from 0 to 4 while the
>> comment explains only values 0,1,2.
>
> This is not just a comment fix; you are clearly changing the behavior
> of the function in some way.
>

The previous version was returning 3 (mount point) even if the dir
contains something after the lost+found directory. I think this case
deserves a 4 output. For example:

lost+found
zzz.txt

give the result 3.

If the directory contains

aaa.txt
lost+found

the result is instead 4.

This doesn't make much difference, as 3 and 4 are both error condition
for all the callers, but the current behavior looks odd to me, and
surely is not what one can expect reading the comments.

My version returns 3 only if the lost+found file is alone in the
directory (eventually ignoring dot files along it, as it was doing before)

Regards,
Marco

--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: File based Incremental backup v8
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: PATCH: decreasing memory needlessly consumed by array_agg