aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-08-23 23:22:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-08-23 23:22:45 +0000
commit4dbb880d3c77a580ef9634b93af26eaf64484ddb (patch)
tree9caf91a5e2b4746f56eaa769033ecaeef06ca4d6 /src/backend/access/transam/xlog.c
parent059912ce2e1952a591d2d61d666b07aed5fa8ad6 (diff)
downloadpostgresql-4dbb880d3c77a580ef9634b93af26eaf64484ddb.tar.gz
postgresql-4dbb880d3c77a580ef9634b93af26eaf64484ddb.zip
Rearrange pg_subtrans handling as per recent discussion. pg_subtrans
updates are no longer WAL-logged nor even fsync'd; we do not need to, since after a crash no old pg_subtrans data is needed again. We truncate pg_subtrans to RecentGlobalXmin at each checkpoint. slru.c's API is refactored a little bit to separate out the necessary decisions.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index b9d0398b621..5c07795c8a9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.162 2004/08/12 19:03:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.163 2004/08/23 23:22:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4918,6 +4918,14 @@ CreateCheckPoint(bool shutdown, bool force)
if (!shutdown)
PreallocXlogFiles(recptr);
+ /*
+ * Truncate pg_subtrans if possible. We can throw away all data before
+ * the oldest XMIN of any running transaction. No future transaction will
+ * attempt to reference any pg_subtrans entry older than that (see Asserts
+ * in subtrans.c).
+ */
+ TruncateSUBTRANS(GetOldestXmin(true));
+
LWLockRelease(CheckpointLock);
}