Re: BUG #13888: pg_dump write error

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, kunschikov(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13888: pg_dump write error
Date: 2016-02-02 21:56:33
Message-ID: 56789B34-35AF-4A95-B922-332C685265AB@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On February 2, 2016 10:12:54 PM GMT+01:00, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2016-02-02 22:31:35 Re: BUG #13908: Query returns too few rows
Previous Message Tom Lane 2016-02-02 21:12:54 Re: BUG #13888: pg_dump write error