Re: Fwd: Is the fsync() fake on FreeBSD6.1?

Поиск
Список
Период
Сортировка
От Andrew - Supernews
Тема Re: Fwd: Is the fsync() fake on FreeBSD6.1?
Дата
Msg-id slrneh8gp1.2ea3.andrew+nonews@atlantis.supernews.net
обсуждение исходный текст
Ответ на Fwd: Is the fsync() fake on FreeBSD6.1?  (Jim Nasby <jim@nasby.net>)
Ответы Re: Fwd: Is the fsync() fake on FreeBSD6.1?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Fwd: Is the fsync() fake on FreeBSD6.1?  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Список pgsql-hackers
On 2006-09-22, Jim Nasby <jim@nasby.net> wrote:
> I thought folks might be interested in this... note in particular the  
> comment about linux.

I don't believe that either person in that discussion knows what they are
really talking about.

fsync() on FreeBSD does, as is required, force any modified data for the
file, plus any metadata, plus any modifications to any parent directories,
to the underlying disk device and waits for that device to report the
write as complete.

Whether the underlying device lies about the write completion is another
matter. All current SCSI disks have WCE enabled by default, which means
that they will lie about write completion if FUA was not set in the
request, which FreeBSD never sets. (It's not possible to get correct
results by having fsync() somehow selectively set FUA, because that would
leave previously-completed requests in the cache.)

WCE can be disabled on either a temporary or permanent basis by changing
the appropriate modepage. It's possible that Linux does this automatically,
or sets FUA on all writes, though that would surprise me considerably;
however I disclaim any knowledge of Linux internals.

On FreeBSD, this command will disable WCE permanently on a SCSI drive:

echo 'WCE: 0' | camcontrol modepage daXX -m 8 -P3 -e

(use -P0 to disable it only temporarily, or you can use just the second of
those commands alone to interactively edit the mode page)

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Release Notes: Major Changes in 8.2
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: advisory locks and permissions