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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-committers(at)postgresql(dot)org, Greg Stark <stark(at)postgresql(dot)org>
Subject: Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after
Date: 2010-02-22 02:54:40
Message-ID: 3943.1266807280@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-02-22 03:58:29 Re: [COMMITTERS] pgsql: Oops, don't forget to rewind the directory before scanning it to
Previous Message Tom Lane 2010-02-22 02:50:10 pgsql: Fix multiple copy and paste-o's.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-02-22 03:28:28 Time travel on the buildfarm
Previous Message Fujii Masao 2010-02-22 02:38:52 Re: pgsql: Oops, don't forget to rewind the directory before scanning it to