Re: fallocate / posix_fallocate for new WAL file creation (etc...)

From: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fallocate / posix_fallocate for new WAL file creation (etc...)
Date: 2013-06-17 02:59:39
Message-ID: CAKuK5J26Ls90Ry2Ldgj+uoU3_DbfsJsO4yKxx_0a-pw3f8Q8VQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 14, 2013 at 12:06 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> On Sat, 2013-05-25 at 13:55 -0500, Jon Nelson wrote:
>> Ack. I've revised the patch to always have the GUC (for now), default
>> to false, and if configure can't find posix_fallocate (or the user
>> disables it by way of pg_config_manual.h) then it remains a GUC that
>> simply can't be changed.
>
> Why have a GUC here at all? Perhaps this was already discussed, and I
> missed it? Is it just for testing purposes, or did you intend for it to
> be in the final version?

As Greg Smith noted, right now it's only for testing purposes.

> * The other code assumes that no errno means ENOSPC. We should be
> consistent about that assumption, and do the same thing in the fallocate
> case.

Unlike write(2), posix_fallocate does *not* set errno, but instead
returns a subset of the errno values as it's return code. The current
approach was suggested to me by Andres Freund and Alvaro Herrera.

> * You check for the presence of posix_fallocate at configure time, but
> don't #ifdef the call site. It looks like you removed this from the v2
> patch, was there a reason for that? Won't that cause build errors for
> platforms without it?

Indeed! I believe I have corrected the error and will be sending out a
revised patch (v5), once the performance and back-testing have
completed.

--
Jon

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robins Tharakan 2013-06-17 03:36:09 Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
Previous Message Amit Kapila 2013-06-17 02:54:59 Re: [9.4 CF 1] Commit Fest has started