Re: initdb -S and tablespaces

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: initdb -S and tablespaces
Дата
Msg-id 20140929095410.GC4716@alap3.anarazel.de
обсуждение исходный текст
Ответ на initdb -S and tablespaces  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Ответы Re: initdb -S and tablespaces  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Re: initdb -S and tablespaces  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Список pgsql-hackers
On 2014-09-29 14:09:01 +0530, Abhijit Menon-Sen wrote:
> Hi.
> 
> I just noticed that initdb -S ("Safely write all database files to disk
> and exit") does (only) the following in perform_fsync:
> 
>     pre_sync_fname(pdir, true);
>     walkdir(pg_data, pre_sync_fname);
> 
>     fsync_fname(pdir, true);
>     walkdir(pg_data, fsync_fname);
> 
> walkdir() reads the directory and calls itself recursively for S_ISDIR
> entries, or calls the function for S_ISREG entries… which means it
> doesn't follow links.
> 
> Which means it doesn't fsync the contents of tablespaces.

Which means at least pg_upgrade is unsafe right
now... c.f. 630cd14426dc1daf85163ad417f3a224eb4ac7b0.

Note that the perform_fsync() *was* ok for its original purpose in
initdb. At the end of initdb there's no relevant tablespaces. But if
used *after* pg_upgrade, that's not necessarily the case.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Patch to support SEMI and ANTI join removal
Следующее
От: Abhijit Menon-Sen
Дата:
Сообщение: Re: initdb -S and tablespaces