summaryrefslogtreecommitdiff
path: root/src/include/access/transam.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-03-13 01:17:06 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-03-13 01:17:06 +0000
commit4d14fe0048cf80052a3ba2053560f8aab1bb1b22 (patch)
tree599c7fde5eb9b889e507b2da77fd8c0300a5dfc7 /src/include/access/transam.h
parentb246510ccc8db96bf7a536a305cccf65aab21ce8 (diff)
XLOG (and related) changes:
* Store two past checkpoint locations, not just one, in pg_control. On startup, we fall back to the older checkpoint if the newer one is unreadable. Also, a physical copy of the newest checkpoint record is kept in pg_control for possible use in disaster recovery (ie, complete loss of pg_xlog). Also add a version number for pg_control itself. Remove archdir from pg_control; it ought to be a GUC parameter, not a special case (not that it's implemented yet anyway). * Suppress successive checkpoint records when nothing has been entered in the WAL log since the last one. This is not so much to avoid I/O as to make it actually useful to keep track of the last two checkpoints. If the things are right next to each other then there's not a lot of redundancy gained... * Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs on alternate bytes. Polynomial borrowed from ECMA DLT1 standard. * Fix XLOG record length handling so that it will work at BLCKSZ = 32k. * Change XID allocation to work more like OID allocation. (This is of dubious necessity, but I think it's a good idea anyway.) * Fix a number of minor bugs, such as off-by-one logic for XLOG file wraparound at the 4 gig mark. * Add documentation and clean up some coding infelicities; move file format declarations out to include files where planned contrib utilities can get at them. * Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or every CHECKPOINT_TIMEOUT seconds, whichever comes first. It is also possible to force a checkpoint by sending SIGUSR1 to the postmaster (undocumented feature...) * Defend against kill -9 postmaster by storing shmem block's key and ID in postmaster.pid lockfile, and checking at startup to ensure that no processes are still connected to old shmem block (if it still exists). * Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency stop, for symmetry with postmaster and xlog utilities. Clean up signal handling in bootstrap.c so that xlog utilities launched by postmaster will react to signals better. * Standalone bootstrap now grabs lockfile in target directory, as added insurance against running it in parallel with live postmaster.
Diffstat (limited to 'src/include/access/transam.h')
-rw-r--r--src/include/access/transam.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/include/access/transam.h b/src/include/access/transam.h
index 620f6e59105..460de699886 100644
--- a/src/include/access/transam.h
+++ b/src/include/access/transam.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: transam.h,v 1.29 2001/01/24 19:43:19 momjian Exp $
+ * $Id: transam.h,v 1.30 2001/03/13 01:17:06 tgl Exp $
*
* NOTES
* Transaction System Version 101 now support proper oid
@@ -79,7 +79,7 @@ typedef unsigned char XidStatus;/* (2 bits) */
* their numbering at 512.
*
* The first 4 bytes of this relation store the version
- * number of the transction system.
+ * number of the transaction system.
* ----------------
*/
typedef struct LogRelationContentsData
@@ -100,13 +100,16 @@ typedef LogRelationContentsData *LogRelationContents;
* is updated in place whenever the variables change.
*
* The first 4 bytes of this relation store the version
- * number of the transction system.
+ * number of the transaction system.
*
* Currently, the relation has only one page and the next
* available xid, the last committed xid and the next
* available oid are stored there.
+ *
+ * XXX As of 7.1, pg_variable isn't used anymore; this is dead code.
* ----------------
*/
+#ifdef NOT_USED
typedef struct VariableRelationContentsData
{
XLogRecPtr LSN;
@@ -117,6 +120,7 @@ typedef struct VariableRelationContentsData
} VariableRelationContentsData;
typedef VariableRelationContentsData *VariableRelationContents;
+#endif /* NOT_USED */
/*
* VariableCache is placed in shmem and used by
@@ -124,8 +128,9 @@ typedef VariableRelationContentsData *VariableRelationContents;
*/
typedef struct VariableCacheData
{
- TransactionId nextXid;
- Oid nextOid;
+ TransactionId nextXid; /* next XID to assign */
+ uint32 xidCount; /* XIDs available before must do XLOG work */
+ Oid nextOid; /* and similarly for OIDs */
uint32 oidCount;
} VariableCacheData;
@@ -184,7 +189,8 @@ extern int RecoveryCheckingEnableState;
extern bool AMI_OVERRIDE;
/* in varsup.c */
-extern int OidGenLockId;
+extern SPINLOCK OidGenLockId;
+extern SPINLOCK XidGenLockId;
extern VariableCache ShmemVariableCache;
#endif /* TRAMSAM_H */