From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: kunschikov@gmail.com, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13888: pg_dump write error
Date: Tue, 02 Feb 2016 22:56:33 +0100
Message-ID: <56789B34-35AF-4A95-B922-332C685265AB@anarazel.de> (raw)
In-Reply-To: <19038.1454447574@sss.pgh.pa.us>
References: <20160127113326.GA639380@alvherre.pgsql>
<19038.1454447574@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On February 2, 2016 10:12:54 PM GMT+01:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>Actually, now that I think about it while not in an airport, what I
>think we really need is logic along the lines of
>
> errno = 0;
> nbytes = fwrite(...);
> if (nbytes != expected && errno == 0)
> errno = ENOSPC;
>
>ie, assume a short write implies out-of-disk-space. I believe that
>is what we do in most (hopefully all) cases in the backend; see for
>example UpdateControlFile() in xlog.c.
There's an exception: when writing WAL we intentionally retry on short writes. IIRC Heikki added that after we found a case where large writes returned short, but non zero, and trying again to finish the rest works. I'm nor sure of there aren't other cases where that should be done, die to large writes.
Andres
---
Please excuse brevity and formatting - I am writing this on my mobile phone.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, michael.paquier@gmail.com
Subject: Re: BUG #13888: pg_dump write error
In-Reply-To: <56789B34-35AF-4A95-B922-332C685265AB@anarazel.de>
References: <20160127113326.GA639380@alvherre.pgsql> <19038.1454447574@sss.pgh.pa.us> <56789B34-35AF-4A95-B922-332C685265AB@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