Adjust WAL code so that checkpoints truncate the xlog at the previous
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/dbase/dbf.c | modified | +5 −10 |
| contrib/pg_resetxlog/pg_resetxlog.c | modified | +12 −1 |
| src/backend/access/transam/xlog.c | modified | +38 −5 |
| src/backend/storage/file/fd.c | modified | +8 −1 |
| src/backend/storage/smgr/md.c | modified | +5 −1 |
| src/backend/utils/init/miscinit.c | modified | +8 −2 |