Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 3888710B77A6 for ; Sun, 15 Jul 2012 22:55:05 -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 1SqaWd-0006Oo-VF for pgsql-performance@postgresql.org; Mon, 16 Jul 2012 01:55:05 +0000 Received: by pbbrp8 with SMTP id rp8so9212123pbb.19 for ; Sun, 15 Jul 2012 18:54:51 -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=GOME69O76Qf8fqrMEQnvN58Hi/WjBS9UEBtJp76RNjc=; b=jyl3hJRMV8YU48KkFRcYG34TbtCcShHtHBCk2NdgxRbXeql02WObvb+PAhrgu7xK6o qU1hX15Ec3JK/refiX3GhaJCzJry1dK2v3wd/RgccJ3D2MM39SgycaQyPVOYO4ZzQ/I4 JF60+jsvM+I7goYQEXW5wvHdzHu0h+CiMoU54eZbeK3LIyNlEsYlzdxiV7OavHof5n5+ IiD/VY4xqBrHdDT/glGI8GbyKfTMA1PSzWwUtcvTokS43df6eX3k5b0pj8e35bfiQFk4 /1M21e224ZxRPJuoZPz4X8S6q1wi7WsDMGVsWcYfTE/JOO+og/fXbFyj3NnGvKL9HUXU segQ== Received: by 10.68.197.198 with SMTP id iw6mr22786400pbc.36.1342403691171; Sun, 15 Jul 2012 18:54:51 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id qc5sm10842262pbb.6.2012.07.15.18.54.47 (version=SSLv3 cipher=OTHER); Sun, 15 Jul 2012 18:54:50 -0700 (PDT) Message-ID: <50037464.7020503@ringerc.id.au> Date: Mon, 16 Jul 2012 09:54:44 +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 , "pgsql-performance@postgresql.org" CC: Jeff Janes , Daniel Farina , =?ISO-8859-1?Q?=22Harold_A=2E_Gim=E9nez=22?= Subject: Proposed change for 9.3(?): Require full restart to change fsync parameter, not just pg_ctl reload 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: ALoCoQn0dB90w8VxsGlLtD4ZAFXAGPHqd8C40ObJVlHnRlL3qWxBOR+la8ToNeA1XRirifuiAr6B X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/190 X-Sequence-Number: 47371 Hi all Some performance improvements have been proposed - probably for 9.3 - that will mean the `fsync' GUC can only be changed with a full cluster restart. See quoted, at end of message. It is currently possible to change `fsync' by altering postgresql.conf and issuing a `pg_ctl reload' . It is not clear how safe this really is even now, and changes proposed to reduce the amount of expensive bookkeeping done when fsync is set to 'off' will make it even less safe. Consequently, it is proposed that the ability to change the fsync setting while Pg is running be removed. fsync=off is very unsafe anyway, and these days production setups are able to get similar results with async commits and group commit. Is there anyone here relying on being able to change fsync=off to fsync=on at runtime? If so, what for, and what does it gain you over use of group/async commit? For related discussion see the -hackers thread: "DELETE vs TRUNCATE explanation" http://archives.postgresql.org/message-id/CAMkU=1yLXvODRZZ_=fgrEeJfk2tvZPTTD-8n8BwrAhNz_WBT0A@mail.gmail.com and the background threads: "PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones." http://archives.postgresql.org/message-id/CAFXpGYbgmZYij4TgCbOF24-usoiDD0ASQeaVAkYtB7E2TYm8Wg@mail.gmail.com "DELETE vs TRUNCATE explanation" http://archives.postgresql.org/message-id/4FFCCAC4.4030503@ringerc.id.au On 07/16/2012 09:37 AM, Tom Lane wrote: > Craig Ringer writes: >> On 07/16/2012 02:29 AM, Tom Lane wrote: >>> Yeah, you have a point there. It's not real clear that switching fsync >>> from off to on is an operation that we can make any guarantees about, >>> short of executing something like the code recently added to initdb >>> to force-sync the entire PGDATA tree. > >> 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. > > regards, tom lane >