Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1F9AB133798E for ; Thu, 7 Apr 2011 13:16:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 53904-01 for ; Thu, 7 Apr 2011 16:16:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mail.postgresql.org (Postfix) with ESMTP id 9E62813364DE for ; Thu, 7 Apr 2011 13:16:21 -0300 (ADT) Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lo3Ka-1PRxYC2M5Q-00gNDx; Thu, 07 Apr 2011 18:16:21 +0200 Message-ID: <4D9DE376.2090704@2ndQuadrant.com> Date: Thu, 07 Apr 2011 12:16:54 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Background fsck References: <4D9CEA3F.5050603@wp.pl> In-Reply-To: <4D9CEA3F.5050603@wp.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:vas4Xz0mHKgg/iyCsKwouKUNpTZ1Hbe4MQrUGPU1U/P Ie831xjvsBs5hkFYcGwHSdBd3w3S3vyrrQgxED2DjYvE01gl1t RQAQOqdGsw5Ew9+C8cYrBXGSGVkaAOaTKaij4n78VYxYlgGSSD ocTJDfuGk2ikNrQCcDDx/KYDajQdVqWEZDfLRJ7eKKQAE/y0UE V26YfTu5lS0k4oXwY4Kyz4Fe/BE/UXljz0i0sDy+to= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201104/76 X-Sequence-Number: 43138 On 04/06/2011 06:33 PM, Ireneusz Pluta wrote: > I saw some recommendations from people on the net not to use > background fsck when running PostgreSQL on FreeBSD. As I recall, these > opinions were just thoughts of people which they shared with the > community, following their bad experience caused by using background fsck. Presumably you're talking about reports like these two: http://blog.e-shell.org/266 http://lists.freebsd.org/pipermail/freebsd-current/2007-July/074773.html > But waiting so much time (like now) during foreground fsck of a large > data filesystem after unclean shutdown, makes me to come to this group > to ask whether I really need to avoid background fsck on a PostgreSQL > machine? The soft update code used in FreeBSD makes sure that there's no damage to the filesystem that PostgreSQL can't recover from. Once the WAL is replayed after a crash, the database is consistent. The main purpose of the background fsck is to find "orphaned" space, things that the filesystem incorrectly remembers the state of in regards to whether it was allocated and used. In theory, there's no reason that can't happen in the background, concurrent with normal database activity. In practice, background fsck is such an infrequently used piece of code that it's developed a bit of a reputation for being buggier than average. It's really hard to test it, filesystem code is complicated, and the sort of inconsistent data you get after a hard crash is often really surprising. I wouldn't be too concerned about the database integrity, but there is a small risk that background fsck will run into something unexpected and panic. And that's a problem you're much less likely to hit using the more stable regular fsck code; thus the recommendations by some to avoid it. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books