Re: BUG #13888: pg_dump write error - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #13888: pg_dump write error
Date
Msg-id 56789B34-35AF-4A95-B922-332C685265AB@anarazel.de
Whole thread Raw
In response to Re: BUG #13888: pg_dump write error  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #13888: pg_dump write error
List pgsql-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
casewhere large writes returned short, but non zero, and trying again to finish the rest works. I'm nor sure of there
aren'tother cases where that should be done, die to large writes. 

Andres

---
Please excuse brevity and formatting - I am writing this on my mobile phone.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #13888: pg_dump write error
Next
From: dmitry-ryabov@mail.ru
Date:
Subject: BUG #13906: improper hstore_to_json_loose functioning