Re: New server: SSD/RAID recommendations?

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: "Wes Vaske (wvaske)" <wvaske(at)micron(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: New server: SSD/RAID recommendations?
Date: 2015-07-07 19:53:21
Message-ID: 559C2E31.4060107@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(at)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Graeme B. Bell 2015-07-07 19:59:54 Re: New server: SSD/RAID recommendations?
Previous Message Merlin Moncure 2015-07-07 18:22:51 Re: New server: SSD/RAID recommendations?