1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Adjust WAL code so that checkpoints truncate the xlog at the previous

checkpoint's redo pointer, not its undo pointer, per discussion in
pghackers a few days ago.  No point in hanging onto undo information
until we have the ability to do something with it --- and this solves
a rather large problem with log space for long-running transactions.
Also, change all calls of write() to detect the case where write
returned a count less than requested, but failed to set errno.
Presume that this situation indicates ENOSPC, and give the appropriate
error message, rather than a random message associated with the previous
value of errno.
This commit is contained in:
Tom Lane
2001-06-06 17:07:46 +00:00
parent ce370eec35
commit 1173344e74
6 changed files with 76 additions and 20 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.84 2001/05/10 20:38:49 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.85 2001/06/06 17:07:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -582,8 +582,12 @@ mdblindwrt(RelFileNode rnode,
status = SM_SUCCESS;
/* write and optionally sync the block */
errno = 0;
if (write(fd, buffer, BLCKSZ) != BLCKSZ)
{
/* if write didn't set errno, assume problem is no disk space */
if (errno == 0)
errno = ENOSPC;
elog(DEBUG, "mdblindwrt: write() failed: %m");
status = SM_FAIL;
}