Re: sync() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: sync()
Date
Msg-id 1610.1042008162@sss.pgh.pa.us
Whole thread Raw
In response to Re: sync()  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> Can someone tell me why we need sync() here?

> ?? I thought WAL files are synced by pg_fsync() (if needed).

They are.  But to write a checkpoint record --- which implies that the
WAL records before it need no longer be replayed --- we have to ensure
that all the changes-so-far in the regular database files are written
down to disk.  That is what we need sync() for.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: sync()
Next
From: Tom Lane
Date:
Subject: Re: sync()