diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2007-10-24 20:55:36 +0000 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2007-10-24 20:55:36 +0000 |
commit | 745c1b2c2ab8385c8392ff10383a64527e3150b7 (patch) | |
tree | 5131b38db8268f22d6202869e3e7c7ab4fc5056e /src/include/storage/proc.h | |
parent | 3ef18797b83b9b274218009802a5994b7f41c818 (diff) |
Rearrange vacuum-related bits in PGPROC as a bitmask, to better support
having several of them. Add two more flags: whether the process is
executing an ANALYZE, and whether a vacuum is for Xid wraparound (which
is obviously only set by autovacuum).
Sneakily move the worker's recently-acquired PostAuthDelay to a more useful
place.
Diffstat (limited to 'src/include/storage/proc.h')
-rw-r--r-- | src/include/storage/proc.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 9fefa0a5a93..4ffb51b4345 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.100 2007/09/05 18:10:48 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.101 2007/10/24 20:55:36 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -38,6 +38,15 @@ struct XidCache TransactionId xids[PGPROC_MAX_CACHED_SUBXIDS]; }; +/* Flags for PGPROC->vacuumFlags */ +#define PROC_IS_AUTOVACUUM 0x01 /* is it an autovac worker? */ +#define PROC_IN_VACUUM 0x02 /* currently running lazy vacuum */ +#define PROC_IN_ANALYZE 0x04 /* currently running analyze */ +#define PROC_VACUUM_FOR_WRAPAROUND 0x08 /* set by autovac only */ + +/* flags reset at EOXact */ +#define PROC_VACUUM_STATE_MASK (0x0E) + /* * Each backend has a PGPROC struct in shared memory. There is also a list of * currently-unused PGPROC structs that will be reallocated to new backends. @@ -82,8 +91,7 @@ struct PGPROC bool inCommit; /* true if within commit critical section */ - bool inVacuum; /* true if current xact is a LAZY VACUUM */ - bool isAutovacuum; /* true if it's autovacuum */ + uint8 vacuumFlags; /* vacuum-related flags, see above */ /* Info about LWLock the process is currently waiting for, if any. */ bool lwWaiting; /* true if waiting for an LW lock */ |