Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-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

pgsql-hackers by date

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

pgsql-committers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group