1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

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.
This commit is contained in:
Tom Lane
2004-08-23 23:22:45 +00:00
parent 059912ce2e
commit 4dbb880d3c
13 changed files with 387 additions and 436 deletions

View File

@ -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);
}