From: Andres Freund <andres@anarazel.de>
To: Christoph Berg <myon@debian.org>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call
Date: Mon, 24 Apr 2023 17:16:23 -0700
Message-ID: <20230425001623.im5uquriqlk4ayy6@awork3.anarazel.de> (raw)
In-Reply-To: <20230424223225.gle3x3sw5m4div2l@awork3.anarazel.de>
References: <E1pk6ud-001WhT-N8@gemulon.postgresql.org>
<ZEZDj1H61ryrmY9o@msg.df7cb.de>
<20230424223225.gle3x3sw5m4div2l@awork3.anarazel.de>
Hi,
On 2023-04-24 15:32:25 -0700, Andres Freund wrote:
> On 2023-04-24 10:53:35 +0200, Christoph Berg wrote:
> > I'm often seeing PG16 builds erroring out in the pgbench tests:
> > I don't think the disk is full since it's always hitting that same
> > spot, on some of the builds:
>
> Yea, the EINTR pretty clearly indicates that it's not really out-of-space.
FWIW, I tried to reproduce this, without success - not too surprising, I
assume it's rather timing dependent.
> We obviously can add a retry loop to FileFallocate(), similar to what's
> already present e.g. in FileRead(). But I wonder if we shouldn't go a bit
> further, and do it for all the fd.c routines where it's remotely plausible
> EINTR could be returned? It's a bit silly to add EINTR retries one-by-one to
> the functions.
>
>
> The following are documented to potentially return EINTR, without fd.c having
> code to retry:
>
> - FileWriteback() / pg_flush_data()
> - FileSync() / pg_fsync()
> - FileFallocate()
> - FileTruncate()
>
> With the first two there's the added complication that it's not entirely
> obvious whether it'd be better to handle this in File* or pg_*. I'd argue the
> latter is a bit more sensible?
A prototype of that approach is attached. I pushed the retry handling into the
pg_* routines where applicable. I guess we could add pg_* routines for
FileFallocate(), FilePrewarm() etc as well, but I didn't do that here.
Christoph, could you verify this fixes your issue?
Greetings,
Andres Freund
Attachments:
[text/x-diff] v1-0001-fd.c-Retry-after-EINTR-in-more-places.patch (0B, ../20230425001623.im5uquriqlk4ayy6@awork3.anarazel.de/2-v1-0001-fd.c-Retry-after-EINTR-in-more-places.patch)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de, myon@debian.org, thomas.munro@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call
In-Reply-To: <20230425001623.im5uquriqlk4ayy6@awork3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox