Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 95E8D33A3E9 for ; Sun, 15 Jul 2012 22:43:24 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SqaLJ-0006Ec-PT for pgsql-hackers@postgresql.org; Mon, 16 Jul 2012 01:43:23 +0000 Received: by pbbrp8 with SMTP id rp8so9196389pbb.19 for ; Sun, 15 Jul 2012 18:43:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=hNEkjAzLXNjV1kvq0fIoUit82+TcuxOODuXogKQwtUc=; b=iudmVNOJFCNiHZ5vT3/1iVUAjue6FPWSLleo/spjUnYQ4fXwdCRyLcRa7grOaDf5Ws 2ZSvMN4j96WL3Nz9mXnDAzH+cLi2sUH8AIhN0u4U8iX5kEfuEky9MBLB5nKA8/jo4Blu m7GEh2LgTXHjfJ5iKtbNd4uou0Hmh36L+W+kl50/hOGlgdr6CBz2ttY4u8pfvFjVu8ul kKmbl9s8jhc+ksDwqU4ClbUMlgxz51cN6d/mHEt/kJ3kbsA1iauxtAjmppgd6JXdTdsf N5UhSUW3xhk6G9hr5QGE3AVnYARyhQRvq0tVw4v9faKtarx9cVI9PVdk3D64EOFvP7F9 jQLQ== Received: by 10.68.203.7 with SMTP id km7mr22733775pbc.7.1342402988037; Sun, 15 Jul 2012 18:43:08 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id ka5sm10817003pbb.37.2012.07.15.18.43.04 (version=SSLv3 cipher=OTHER); Sun, 15 Jul 2012 18:43:07 -0700 (PDT) Message-ID: <500371A6.5010906@ringerc.id.au> Date: Mon, 16 Jul 2012 09:43:02 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Tom Lane CC: Jeff Janes , pgsql-hackers , Daniel Farina , =?ISO-8859-1?Q?=22Harold_A=2E_Gim?= =?ISO-8859-1?Q?=E9nez=22?= Subject: Re: [PERFORM] DELETE vs TRUNCATE explanation References: <4FFCCAC4.4030503@ringerc.id.au> <23853.1342015548@sss.pgh.pa.us> <32078D4B40DD40ECB739D0ECD7D95996@gmail.com> <19949.1342376967@sss.pgh.pa.us> <50035EE3.8030607@ringerc.id.au> <27245.1342402661@sss.pgh.pa.us> In-Reply-To: <27245.1342402661@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmAdRnxBEjBGQayODnaVXj/mgbZGOC2+BhY0bpU+uGiC8fm2+Gq5thWqRgSDB6ZI81HDnhG X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/695 X-Sequence-Number: 211378 On 07/16/2012 09:37 AM, Tom Lane wrote: >> There's one way that doesn't have any housekeeping cost to Pg. It's >> pretty bad manners if there's anybody other than Pg on the system though: >> sync() > Yeah, I thought about that: if we could document that issuing a manual > sync after turning fsync on leaves you in a guaranteed-good state once > the sync is complete, it'd probably be fine. However, I'm not convinced > that we could promise that with a straight face. In the first place, > PG has only very weak guarantees about how quickly all processes in the > system will absorb a GUC update. In the second place, I'm not entirely > sure that there aren't race conditions around checkpoints and the fsync > request queue (particularly if we do what Jeff is suggesting and > suppress queuing requests at the upstream end). It might be all right, > or it might be all right after expending some work, but the whole thing > is not an area where I think anyone wants to spend time. I think it'd > be much safer to document that the correct procedure is "stop the > database, do a manual sync, enable fsync in postgresql.conf, restart the > database". And if that's what we're documenting, we lose little or > nothing by marking fsync as PGC_POSTMASTER. Sounds reasonable to me; I tend to view fsync=off as a testing feature anyway. Will clone onto -general and see if anyone yells. -- Craig Ringer