Re: fallocate / posix_fallocate for new WAL file creation (etc...) - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: fallocate / posix_fallocate for new WAL file creation (etc...)
Date
Msg-id 1372615313.19747.13.camel@jdavis
Whole thread Raw
In response to Re: fallocate / posix_fallocate for new WAL file creation (etc...)  (Greg Smith <greg@2ndQuadrant.com>)
Responses Re: fallocate / posix_fallocate for new WAL file creation (etc...)
List pgsql-hackers
On Tue, 2013-05-28 at 22:10 -0400, Greg Smith wrote:
> I was just thinking of something to run in your test program, not
> another build time check.  Just run the new allocation sequence, and
> then check the resulting WAL file for a) correct length, and b) 16K of
> zero bytes.  I would like to build some confidence that posix_fallocate
> is operating correctly in this context on at least one platform.  My
> experience with Linux handling this class of functions correctly has
> left me skeptical of them working until that's proven to be the case.

As I understand it, you are basically asking if posix_fallocate() works
at all anywhere.

Simple test program attached, which creates two files and fills them:
one by 2048 8KB writes; and another by 1 posix_fallocate of 16MB. Then,
I just cmp the resulting files (and also "ls" them, to make sure they
are 16MB).

Passes on my workstation:
$ uname -a
Linux jdavis 3.5.0-34-generic #55-Ubuntu SMP Thu Jun 6 20:18:19 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux

Regards,
    Jeff Davis


Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: review: Non-recursive processing of AND/OR lists
Next
From: Jeff Davis
Date:
Subject: Re: fallocate / posix_fallocate for new WAL file creation (etc...)