Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory - Mailing list pgsql-general

From Tom Lane
Subject Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Date
Msg-id 15552.990636646@sss.pgh.pa.us
Whole thread Raw
In response to Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory  ("Oliver Elphick" <olly@lfix.co.uk>)
Responses Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory  (Chris Jones <chris@mt.sri.com>)
List pgsql-general
"Oliver Elphick" <olly@lfix.co.uk> writes:
> I found the answer to this: the partition had filled up, and so the problem
> was lack of disk space.

> Could we have a more helpful error message?

Indeed.  I don't like your solution however, since it's just papering
over the real problem which is lack of a suitable error code from
write().  Evidently write() isn't setting errno as long as it's able
to write at least some data.  Perhaps we could do

    errno = 0;
    if (write(...) != expectedbytecount)
    {
        int    save_errno = errno;

        unlink(tmp);

        errno = save_errno ? save_errno : ENOSPC;

        elog(...);
    }

Comments?  Is it reasonable to guess that the problem must be ENOSPC
if write doesn't write all the bytes but also doesn't set errno?
Are there any systems that don't define ENOSPC?

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Vacuumdb message: AbortTransaction and not in-progress ...
Next
From: Tom Lane
Date:
Subject: Re: Estimating costs (was Functional Indices)