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

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, 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 10:15:18
Message-ID: 407d949e1002220215l6fe8816al6703a5dc79e24894@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Mon, Feb 22, 2010 at 2:54 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 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.

Argh. I'll be less careless in the future, I promise.

I had concluded that scanning the original directory was odd but
better because it served to double-check that all the original files
actually made it and also because if there were any unrelated files
present there was no need to fsync them. But I agree it's odd and not
very general for copydir if we decide to use it elsewhere other than
create database.

--
greg

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-02-22 11:47:30 pgsql: Move documentation of all recovery.conf option to a new chapter.
Previous Message Andres Freund 2010-02-22 07:59:36 Re: [COMMITTERS] pgsql: Oops, don't forget to rewind the directory before scanning it to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2010-02-22 10:29:54 Re: A thought on Index Organized Tables
Previous Message Simon Riggs 2010-02-22 09:17:45 Re: scheduler in core