Re: Short writes

From: tomas(at)tuxteam(dot)de
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Short writes
Date: 2006-11-29 09:55:41
Message-ID: 20061129095541.GC23039@www.trapp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Nov 28, 2006 at 05:05:02PM +0100, Martijn van Oosterhout wrote:
> 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
[...]
> It would be interesting to know what other causes there could be for
> short writes.

Interrupted system call?

[Diclaimer: I assume provisions for that are taken, I just don't know
the code around that spot and am just offering an answer to the above
question]

The problem arises from the fact that errno is only guaranteed to be set
on a -1 return value. It'd be nice to have errno set on a short write
too.

So the "right" answer might be to retry a write on a short write and only
to bail out in the <=0 case (raising an "unspecified error" in the 0
case). Ugh.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFbVkdBcgs9XrR2kYRAv/nAJ0WcmWxTFAvyikYghngtzrj98Jn8QCfe4Pb
S6dsxcgnyXeqpj4F7VDCeZs=
=9WIa
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2006-11-29 10:19:39 "Compacting" a relation
Previous Message Pavel Stehule 2006-11-29 09:32:30 small bug in to_char and TM prefix, in RC