On Tue, Nov 28, 2006 at 04:51:35PM +0100, Peter Eisentraut wrote:
> We are currently debugging a problem with error messages like this:
> ERROR: 53100: could not write block 2427137 of relation
> 1663/706306048/706314280: No space left on device
> The device has plenty of space left. The problem appears to be this
> curious code in src/backend/storage/file/fd.c:
> /* if write didn't set errno, assume problem is no disk space */
> if (returnCode != amount && errno == 0)
> errno = ENOSPC;
> What is the rationale for making this assumption?
Essentially, for files short writes are not supposed to happen. For
pipes and sockets it's fairly normal, but for files it's not expected
to ever happen.
Given that write() only has one return value, if all the data cannot be
written, it has to return the number of bytes written and can't return
the actual error.
What probably *should* happen is that a second write is initiated to
write the remainder of the block, at which point the system can say
> We haven't yet figured out why the above error happens, but I suggest
> that we at least make a more accurate error message.
It would be interesting to know what other causes there could be for
Have a nice day,
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
In response to
pgsql-hackers by date
|Next:||From: Andrew Sullivan||Date: 2006-11-28 16:34:32|
|Subject: Re: Incrementing INET fields|
|Previous:||From: Tom Lane||Date: 2006-11-28 16:02:42|
|Subject: Re: Short writes |