Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ysw0c-0005wH-8J for pgsql-admin@arkaria.postgresql.org; Thu, 14 May 2015 16:29:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ysw0b-0004xG-L9 for pgsql-admin@arkaria.postgresql.org; Thu, 14 May 2015 16:29:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ysw0a-0004xA-T4 for pgsql-admin@postgresql.org; Thu, 14 May 2015 16:29:16 +0000 Received: from omr-m10.mx.aol.com ([64.12.143.86]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Ysw0R-0002AO-AC for pgsql-admin@postgresql.org; Thu, 14 May 2015 16:29:15 +0000 Received: from mtaomg-mba02.mx.aol.com (mtaomg-mba02.mx.aol.com [172.26.133.112]) by omr-m10.mx.aol.com (Outbound Mail Relay) with ESMTP id A4219705D32A4; Thu, 14 May 2015 12:29:04 -0400 (EDT) Received: from core-lka04e.mail.aol.com (core-lka04.mail.aol.com [10.76.33.4]) by mtaomg-mba02.mx.aol.com (OMAG/Core Interface) with ESMTP id 2BB5B38000081; Thu, 14 May 2015 12:29:04 -0400 (EDT) Received: from 69.191.241.34 by webstg-m03.mail.aol.com (10.74.51.128) with HTTP (WebMailUI); Thu, 14 May 2015 12:29:03 -0400 Date: Thu, 14 May 2015 12:29:04 -0400 From: Ravi Krishna To: bruce@momjian.us Cc: tgl@sss.pgh.pa.us, pgsql-admin@postgresql.org Message-Id: <14d5342006a-2108-312c5@webstg-m03.mail.aol.com> In-Reply-To: <20150514162610.GB23739@momjian.us> Subject: Re: WAL and O_DIRECT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MB-Message-Source: WebUI X-MB-Message-Type: User X-Mailer: JAS STD X-Originating-IP: [69.191.241.34] x-aol-global-disposition: G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aim.com; s=20140625; t=1431620944; bh=dmcADrgI67qdUjQwKrXh4/VSlE3ZkjpfJ/t6+0AvPZQ=; h=From:To:Subject:Message-Id:Date:MIME-Version:Content-Type; b=EDGwZ/DyI4iF5X0ZaShxbJeHyxm1SgayTCkxQ/cij/6VnxYd6PnxSG8DipbclT0S4 8lj3vMb4veRX3LBWEVnbhsE5ZbZm5nyif2Zoz5dKiEWh4qIL3LuWZ6XFvUay/yGytc SsuveOxlc20eP3SOenu7X9XN4wRVOiQX+9IGztco= x-aol-sid: 3039ac1a85705554cd504592 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Thanks Bruce and Tom. That pretty much explains it. -----Original Message----- From: Bruce Momjian To: Ravi Krishna Cc: tgl ; pgsql-admin Sent: Thu, May 14, 2015 12:26 pm Subject: Re: [ADMIN] WAL and O_DIRECT On Thu, May 14, 2015 at 12:07:04PM -0400, Ravi Krishna wrote:> >> However o= urDB2 folks are raising a concern that PG WAL writes may not be crash safe,= unlesswe are using> >> write back technology in SAN or SSD , which we are = using.>> > What's your point exactly? If the underlying hardware does not = providedurable writes, there's> > nothing PG (or DB2) can do to fix that.> = > >Am I right in concluding that PG WAL writes without underlying h/w cachi= ng isnot crash proof.> Fortunately these days caching is ubiquitous in all= SSD/SANtechnology. Both Oracle and DB2 always open WAL> logs in O_DIRECT. = Is thisthinking outdated with modern technology which caches writes. Wonder= whyOracle/DB2> are not making O_DIRECT optional. I am sure it will increas= e thewrite performance.Basically, O_DIRECT writes through the OS catch dire= ctlyto the storage.Postgres writes to the OS cache, then uses fsync() or an= otherOS call toflush that OS write to the storage --- we just do it in twop= arts.We turn off O_DIRECT for WAL writes because we know another processisg= oing to read it soon, so in that case, we fall back the two-partsolutionof = OS write and fsync-like OS call.-- Bruce Momjian http= ://momjian.us EnterpriseDB http://enterprisedb.= com + Everyone has their own god. + --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin