Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after
Дата
Msg-id 3943.1266807280@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after  (Andres Freund <andres@anarazel.de>)
Ответы Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after
Список pgsql-committers
Andres Freund <andres@anarazel.de> writes:
> I just found a relatively big problem with one of your modifications on the
> patch - you removed the
> FreeDir(xldir);
> xldir = AllocateDir(fromdir);
> pair - unfortunately its crucial because otherwise the DIR does not get
> rewound - that resulted in *no* files getting fsync()ed (otherwise the loop
> above wouldn't have finished yet...).
> I think that was also causing the problems I pointed out in " Directory fsync
> and other fun"...

Actually, that code had *multiple* problems including stat'ing the wrong
file entirely, not to mention that this last commit failed to even
compile.  I also think it should scan the todir not the fromdir, just on
general principles to avoid any possibility of race conditions.

            regards, tom lane

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

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix multiple copy and paste-o's.
Следующее
От: Greg Stark
Дата:
Сообщение: Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after