Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Date: 2001-05-23 16:50:46
Message-ID: 15552.990636646@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Oliver Elphick" <olly(at)lfix(dot)co(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bob Himes 2001-05-23 16:53:52 data/pg_xlog/HUGE_FILE
Previous Message Andrew Sullivan 2001-05-23 16:15:07 dumb question: multiple postmasters on Solaris