pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Wes Vaske (wvaske) <wvaske@micron.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: New server: SSD/RAID recommendations?
Date: Tue, 07 Jul 2015 22:53:21 +0300
Message-ID: <559C2E31.4060107@iki.fi> (raw)
In-Reply-To: <31701C89A44B714FB8D242F806E7286C5AED3892@NTXBOIMBX01.micron.com>
References: <CAFwQ8rfwyBMD7AiL659qtG+UhsOUZthLSBYF7ODTn6TKxJoTPg@mail.gmail.com>
	<VisenaEmail.44.70ed435cef1739b1.14e4c07dd3d@tc7-visena>
	<31701C89A44B714FB8D242F806E7286C5AED32FA@NTXBOIMBX01.micron.com>
	<CAFwQ8rcaFm9YBx81mRJ35U-p4mgiX8tJfEF0BV+7-EcS3HjbxA@mail.gmail.com>
	<31701C89A44B714FB8D242F806E7286C5AED33EB@NTXBOIMBX01.micron.com>
	<CAHyXU0w8bKJvv_FTt43SHEQT9ruZ6Sx6VFP8Bsw+h=FEUEjKCw@mail.gmail.com>
	<A71AF312-79BD-44EC-88B9-FDD9446D1680@skogoglandskap.no>
	<31701C89A44B714FB8D242F806E7286C5AED372E@NTXBOIMBX01.micron.com>
	<559BE965.7090609@iki.fi>
	<CAOzAquLRumW80Tcn+-t6wyzqT4Q6Sbw15R+vVBA+zgp0=_bRwQ@mail.gmail.com>
	<31701C89A44B714FB8D242F806E7286C5AED3892@NTXBOIMBX01.micron.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

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.<low numbers> 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



view thread (43+ messages)  latest in thread

Message-ID: <559C2E31.4060107@iki.fi>
Permalink:  ../559C2E31.4060107@iki.fi/
Also on:    postgresql.org/message-id/559C2E31.4060107@iki.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: hlinnaka@iki.fi, wvaske@micron.com
  Subject: Re: New server: SSD/RAID recommendations?
  In-Reply-To: <559C2E31.4060107@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox