Re: POSIX file updates - Mailing list pgsql-performance

From Tom Lane
Subject Re: POSIX file updates
Date
Msg-id 20606.1207026437@sss.pgh.pa.us
Whole thread Raw
In response to Re: POSIX file updates  (Greg Smith <gsmith@gregsmith.com>)
List pgsql-performance
Greg Smith <gsmith@gregsmith.com> writes:
> Quoting from Lewine's "POSIX Programmer's Guide":

> "After a write() to a regular file has successfully returned, any
> successful read() from each byte position in the file that was modified by
> that write() will return the data that was written by the write()...a
> similar requirement applies to multiple write operations to the same file
> position"

Yeah, I imagine this is what the OP is thinking of.  But note that what
it describes is the behavior of concurrent write() and read() calls
within a normally-functioning system.  I see nothing there that
constrains the order in which writes hit physical disk, nor (to put it
another way) that promises anything much about the state of the
filesystem after a crash.

As you stated, PG is largely independent of these issues anyway.  As
long as the filesystem honors its spec-required contract that it won't
claim fsync() is complete before all the referenced data is safely on
persistent store, we are OK.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance Implications of Using Exceptions
Next
From: Cédric Villemain
Date:
Subject: Re: Bad prepare performance