Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 672DF63256F for ; Sun, 14 Feb 2010 11:32:31 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 44289-02 for ; Sun, 14 Feb 2010 15:31:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pw0-f46.google.com (mail-pw0-f46.google.com [209.85.160.46]) by mail.postgresql.org (Postfix) with ESMTP id 9C1F063256D for ; Sun, 14 Feb 2010 11:32:20 -0400 (AST) Received: by pwj8 with SMTP id 8so386819pwj.19 for ; Sun, 14 Feb 2010 07:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=jUOEhZiBTpVi5uwVFvAJUBPkdVFBQ9diouvy6EQqjDM=; b=AsR3kIO9re4lS+gWOyGxaO9VZZsLqeyy6okv31/QbH3yAABYCRbnf8Kw7UTQadjiiA XaNWaEZdkuPGpD5iWN3TfmH00GyUZI6DUtOa4FBM6qWH2ItyrymWJAMAy9HCpn8l6u5R q4/iPy8p4iHC31pD1AsDC2EyAlFjkOqbsEXc8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=n+4FAVMSaFJKaBr/dD3PaZVsGy8WyRxVtwV1rw8Fwnf6RuHAuX7w5XrthwN/FBzF8p 9B+iR0sSE+z6bPXFDakc0q8RcnJ/dbBFrCnNzH3MJxm3qemLX1K7kxst5aj36kjCTTq7 ESkLNorW5eZj+wKgZ1H6SwHz0cW7hzQfpmY8c= MIME-Version: 1.0 Received: by 10.141.107.19 with SMTP id j19mr152478rvm.257.1266161538062; Sun, 14 Feb 2010 07:32:18 -0800 (PST) In-Reply-To: <407d949e1002140603v1c7515d7t697568a3865ac6fe@mail.gmail.com> References: <4427a97a0912101235x3ade510blcc00d5ce9883c6b6@mail.gmail.com> <20100208030901.GA7407@alvh.no-ip.org> <603c8f071002072053w16897addtd52fcc4cf880df53@mail.gmail.com> <201002110327.35810.andres@anarazel.de> <603c8f071002120749o6a2e9e54h5cf21dc91d1790b9@mail.gmail.com> <407d949e1002140603v1c7515d7t697568a3865ac6fe@mail.gmail.com> From: Greg Stark Date: Sun, 14 Feb 2010 15:31:58 +0000 X-Google-Sender-Auth: 89a6b9a357520165 Message-ID: <407d949e1002140731j85a4f97nc053ec1b0f3cc458@mail.gmail.com> Subject: Re: Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb) To: Robert Haas Cc: Andres Freund , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.497 tagged_above=-10 required=5 tests=AWL=0.102, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/1135 X-Sequence-Number: 157478 On Sun, Feb 14, 2010 at 2:03 PM, Greg Stark wrote: > On Fri, Feb 12, 2010 at 3:49 PM, Robert Haas wrot= e: >> Greg Stark, have you managed to get your access issues sorted out? =A0If > > Yep, will look at this today. So I think we have a bigger problem than just copydir.c. It seems to me we should be fsyncing the table space data directories on every checkpoint. Otherwise any newly created relations or removed relations could disappear even though the data in them was fsynced. I'm thinking I should add an _mdfd_opentblspc(reln) call which returns a file descriptor for the tablespace and have mdsync() use that to sync the directory whenever it fsyncs a relation. It would be nice to remember which tablespaces have been fsynced and only fsync them once though, that would need another hash table just for tablespaces. We probably also need to fsync the pg_xlog directory every time we create or rename an xlog segment. Are there any other places we do directory operations which we need to be permanent? --=20 greg