diff options
Diffstat (limited to 'src/include/storage')
-rw-r--r-- | src/include/storage/bufmgr.h | 4 | ||||
-rw-r--r-- | src/include/storage/bufpage.h | 9 | ||||
-rw-r--r-- | src/include/storage/lock.h | 29 | ||||
-rw-r--r-- | src/include/storage/proc.h | 5 | ||||
-rw-r--r-- | src/include/storage/smgr.h | 5 |
5 files changed, 34 insertions, 18 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 7defaf93f88..e992751f856 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -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/include/storage/bufmgr.h,v 1.82 2004/05/31 19:24:05 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.83 2004/07/01 00:51:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -148,6 +148,8 @@ extern void InitBufferPoolAccess(void); extern char *ShowBufferUsage(void); extern void ResetBufferUsage(void); extern void AtEOXact_Buffers(bool isCommit); +extern void AtSubStart_Buffers(void); +extern void AtEOSubXact_Buffers(bool isCommit); extern void FlushBufferPool(void); extern BlockNumber BufferGetBlockNumber(Buffer buffer); extern BlockNumber RelationGetNumberOfBlocks(Relation relation); diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 5f8012e0ed6..727ec508a3b 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -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/include/storage/bufpage.h,v 1.58 2004/06/05 17:42:46 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/bufpage.h,v 1.59 2004/07/01 00:51:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -126,10 +126,11 @@ typedef struct PageHeaderData typedef PageHeaderData *PageHeader; /* - * Page layout version number 0 is for pre-7.3 Postgres releases. The - * current version number is 1, denoting a new HeapTupleHeader layout. + * Page layout version number 0 is for pre-7.3 Postgres releases. + * Releases 7.3 and 7.4 use 1, denoting a new HeapTupleHeader layout. + * Release 7.5 changed the HeapTupleHeader layout again. */ -#define PG_PAGE_LAYOUT_VERSION 1 +#define PG_PAGE_LAYOUT_VERSION 2 /* ---------------------------------------------------------------- diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index 8c7159c0cb0..650b3269497 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -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/include/storage/lock.h,v 1.77 2004/05/28 05:13:29 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.78 2004/07/01 00:51:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -26,6 +26,14 @@ typedef struct PROC_QUEUE int size; /* number of entries in list */ } PROC_QUEUE; +/* Release options for LockReleaseAll */ +typedef enum +{ + ReleaseAll, /* All my locks */ + ReleaseAllExceptSession, /* All except session locks (Xid = 0) */ + ReleaseGivenXids /* Only locks with Xids in given array */ +} LockReleaseWhich; + /* struct PGPROC is declared in storage/proc.h, but must forward-reference it */ typedef struct PGPROC PGPROC; @@ -165,11 +173,12 @@ typedef struct LOCK * * There are two possible kinds of proclock tags: a transaction (identified * both by the PGPROC of the backend running it, and the xact's own ID) and - * a session (identified by backend PGPROC, with xid = InvalidTransactionId). + * a session (identified by backend PGPROC, with XID = InvalidTransactionId). * * Currently, session proclocks are used for user locks and for cross-xact - * locks obtained for VACUUM. We assume that a session lock never conflicts - * with per-transaction locks obtained by the same backend. + * locks obtained for VACUUM. Note that a single backend can hold locks + * under several different XIDs at once (including session locks). We treat + * such locks as never conflicting (a backend can never block itself). * * The holding[] array counts the granted locks (of each type) represented * by this proclock. Note that there will be a proclock object, possibly with @@ -177,11 +186,11 @@ typedef struct LOCK * Otherwise, proclock objects whose counts have gone to zero are recycled * as soon as convenient. * - * Each PROCLOCK object is linked into lists for both the associated LOCK object - * and the owning PGPROC object. Note that the PROCLOCK is entered into these - * lists as soon as it is created, even if no lock has yet been granted. - * A PGPROC that is waiting for a lock to be granted will also be linked into - * the lock's waitProcs queue. + * Each PROCLOCK object is linked into lists for both the associated LOCK + * object and the owning PGPROC object. Note that the PROCLOCK is entered + * into these lists as soon as it is created, even if no lock has yet been + * granted. A PGPROC that is waiting for a lock to be granted will also be + * linked into the lock's waitProcs queue. */ typedef struct PROCLOCKTAG { @@ -239,7 +248,7 @@ extern bool LockAcquire(LOCKMETHODID lockmethodid, LOCKTAG *locktag, extern bool LockRelease(LOCKMETHODID lockmethodid, LOCKTAG *locktag, TransactionId xid, LOCKMODE lockmode); extern bool LockReleaseAll(LOCKMETHODID lockmethodid, PGPROC *proc, - bool allxids, TransactionId xid); + LockReleaseWhich which, int nxids, TransactionId *xids); extern int LockCheckConflicts(LockMethod lockMethodTable, LOCKMODE lockmode, LOCK *lock, PROCLOCK *proclock, PGPROC *proc, diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index c7283f374cf..1551d7568c5 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -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/include/storage/proc.h,v 1.67 2003/12/01 21:59:25 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.68 2004/07/01 00:51:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -103,7 +103,8 @@ extern int ProcGlobalSemas(int maxBackends); extern void InitProcGlobal(int maxBackends); extern void InitProcess(void); extern void InitDummyProcess(int proctype); -extern void ProcReleaseLocks(bool isCommit); +extern void ProcReleaseLocks(LockReleaseWhich which, + int nxids, TransactionId *xids); extern void ProcQueueInit(PROC_QUEUE *queue); extern int ProcSleep(LockMethod lockMethodTable, LOCKMODE lockmode, diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h index 52040432dcc..e4f0930ef7a 100644 --- a/src/include/storage/smgr.h +++ b/src/include/storage/smgr.h @@ -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/include/storage/smgr.h,v 1.44 2004/06/02 17:28:18 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/smgr.h,v 1.45 2004/07/01 00:51:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -66,6 +66,9 @@ extern BlockNumber smgrtruncate(SMgrRelation reln, BlockNumber nblocks, extern void smgrimmedsync(SMgrRelation reln); extern void smgrDoPendingDeletes(bool isCommit); extern int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr); +extern void AtSubStart_smgr(void); +extern void AtSubCommit_smgr(void); +extern void AtSubAbort_smgr(void); extern void smgrcommit(void); extern void smgrabort(void); extern void smgrsync(void); |