Re: Ensuring data integrity with fsync=off

От: Tom Lane
Тема: Re: Ensuring data integrity with fsync=off
Дата: ,
(см: обсуждение, исходный текст)
Ответ на: Ensuring data integrity with fsync=off  ("Benjamin Arai")
Ответы: Re: Ensuring data integrity with fsync=off  ("Jim C. Nasby")
Список: pgsql-performance

"Benjamin Arai" <> writes:
> Right now I run "sync" afte the updates have finished to ensure that the
> data is synced to disk but I am concerned about the segment data and
> anything else I am missing that PostgreSQL explicitly handles.  Is there
> something I can do in addition to sync to tell PostgreSQL exlplicitly that
> it is time to ensure everything is stored in its final destionation and etc?

You need to give PG a CHECKPOINT command to flush stuff out of its
internal buffers.  After that finishes, a manual "sync" commnd will
push everything down to disk.

You realize, of course, that a system failure while the updates are
running might leave your database corrupt?  As long as you are prepared
to restore from scratch, this might be a good tradeoff ... but don't
let yourself get caught without an up-to-date backup ...

            regards, tom lane

В списке pgsql-performance по дате сообщения:

От: Jaime Casanova
Сообщение: Re: big databases & hospitals
От: Charles Sprickman
Сообщение: Re: SAN/NAS options