Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCYy6-0004S4-Gh for pgsql-performance@arkaria.postgresql.org; Tue, 07 Jul 2015 19:55:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZCYy5-00062s-Ef for pgsql-performance@arkaria.postgresql.org; Tue, 07 Jul 2015 19:55:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCYvr-0003xV-Ng for pgsql-performance@postgresql.org; Tue, 07 Jul 2015 19:53:31 +0000 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZCYvk-0001g7-Tq for pgsql-performance@postgresql.org; Tue, 07 Jul 2015 19:53:31 +0000 Received: by wiwl6 with SMTP id l6so324827969wiw.0 for ; Tue, 07 Jul 2015 12:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=9cBOKmIcrd2jFtbpIsr7l3kDI6qLFiOQP5cJ9h90tpE=; b=WjHUgT+ympR157oJp6QSBtHga8tbZlr/Ypp9YBfm8BD3RZN5s2bBwc/AiD/e7YAIgc Mj9sfx7li5LeFXV/V0Ufiun5UdszRDXJK3u199M3T9JeZbFsiEbxvAuV5ph+yhQZkzQV bDAHW4nRi/VCwW9VV9WX6QxwxqSuByDa5mMe8dLBzma7al8UUSYHi9wUT8qjqvWXno2m oPuQtJ0oHEOBIKUWD/ATrwHHPFsOobNIRz0zOdJL9gyiphpR4l1PxKgNctW1CWnDi276 4P74QKXdefmZhejxFNanR7ww1jSOclkl86Cft8qM2X42uMlmfruFzXDrBIhVe2ntT6kh 1rhw== X-Received: by 10.194.236.199 with SMTP id uw7mr12716797wjc.92.1436298804240; Tue, 07 Jul 2015 12:53:24 -0700 (PDT) Received: from [192.168.1.110] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by smtp.gmail.com with ESMTPSA id az1sm35585988wib.0.2015.07.07.12.53.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 12:53:23 -0700 (PDT) Message-ID: <559C2E31.4060107@iki.fi> Date: Tue, 07 Jul 2015 22:53:21 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: "Wes Vaske (wvaske)" , "pgsql-performance@postgresql.org" Subject: Re: New server: SSD/RAID recommendations? References: <31701C89A44B714FB8D242F806E7286C5AED32FA@NTXBOIMBX01.micron.com> <31701C89A44B714FB8D242F806E7286C5AED33EB@NTXBOIMBX01.micron.com> <31701C89A44B714FB8D242F806E7286C5AED372E@NTXBOIMBX01.micron.com> <559BE965.7090609@iki.fi> <31701C89A44B714FB8D242F806E7286C5AED3892@NTXBOIMBX01.micron.com> In-Reply-To: <31701C89A44B714FB8D242F806E7286C5AED3892@NTXBOIMBX01.micron.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 07/07/2015 09:01 PM, Wes Vaske (wvaske) wrote: > Regarding: > “lie about their fsync status.” > > This is mostly semantics but it might help google searches on the issue. > > A drive doesn’t support fsync(), that’s a filesystem/kernel process. A drive will do a FLUSH CACHE. Before kernels 2.6. the fsync() call wouldn’t sent any ATA or SCSI command to flush the disk cache. Whereas—AFAICT—modern kernels and file system versions*will* do this. When ‘sync’ is called the filesystem will issue the appropriate command to the disk to flush the write cache. > > For ATA, this is “FLUSH CACHE” (E7h). To check support for the command use: > [root@postgres ~]# smartctl --identify /dev/sdu | grep "FLUSH CACHE" > 83 13 1 FLUSH CACHE EXT supported > 83 12 1 FLUSH CACHE supported > 86 13 1 FLUSH CACHE EXT supported > 86 12 1 FLUSH CACHE supported > > The 1s in the 3rd column represent SUPPORTED for the feature listed in the last column. Right, to be precise, the problem isn't the drive lies about fsync(). It lies about FLUSH CACHE instead. Search & replace fsync() with FLUSH CACHE, and the same question remains: When the drive breaks its promise wrt. FLUSH CACHE, does it nevertheless guarantee that the order the data is eventually flushed to disk is consistent with the order in which the data and FLUSH CACHE were sent to the drive? That's an important distinction, because it makes the difference between "the most recent data the application saved might be lost even though the FLUSH CACHE command returned" and "your filesystem is corrupt". - Heikki -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance