Re: initdb and fsync

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: initdb and fsync
Дата
Msg-id 201206182141.02039.andres@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: initdb and fsync  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: initdb and fsync  (Jeff Davis <pgsql@j-davis.com>)
Re: initdb and fsync  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On Monday, June 18, 2012 09:32:25 PM Jeff Davis wrote:
> > > > - could the copydir.c and initdb.c versions of walkdir/sync_fname et
> > > > al be unified?
> > > 
> > > There's a lot of backend-specific code in the copydir versions, like
> > > using ereport() and CHECK_FOR_INTERRUPTS(). I gave a brief attempt at
> > > unifying them before, and concluded that it wouldn't add to the
> > > readability, so I just commented where they came from.
> > 
> > Ok. Sensible reasons. I dislike that we know have two files using
> > different logic (copydir.c only using fadvise, initdb using
> > sync_file_range if available). Maybe we should just move the fadvise and
> > sync_file_range calls into its own common function?
> 
> I don't see fadvise in copydir.c, it looks like it just uses fsync. It
> might speed it up to use a pre-sync call there, too -- database creation
> does take a while.
> 
> If that's in the scope of this patch, I'll do it.
It calls pg_flush_data inside of copy_file which does the posix_fadvise... So 
maybe just put the sync_file_range in pg_flush_data?

Greetings,

Andres

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


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

Предыдущее
От: Leon Smith
Дата:
Сообщение: Transactions over pathological TCP connections
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: initdb and fsync