diff options
| author | Tom Lane | 2005-01-10 21:57:19 +0000 |
|---|---|---|
| committer | Tom Lane | 2005-01-10 21:57:19 +0000 |
| commit | fc299179dff8521a5ab61c15326278d13d2e069e (patch) | |
| tree | 622eaa54e3b2bcc35c854a9c328ae8ef43aadf3e /src/include | |
| parent | 0ce4d56924982c04da226bc890033e377d1ef375 (diff) | |
Separate the functions of relcache entry flush and smgr cache entry flush
so that we can get the size of a shared inval message back down to what it
was in 7.4 (and simplify the logic too). Phase 2 of fixing the
'SMgrRelation hashtable corrupted' problem.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/storage/sinval.h | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/src/include/storage/sinval.h b/src/include/storage/sinval.h index 0fce7466149..092b7220488 100644 --- a/src/include/storage/sinval.h +++ b/src/include/storage/sinval.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/sinval.h,v 1.39 2004/12/31 22:03:42 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/storage/sinval.h,v 1.40 2005/01/10 21:57:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,22 +20,16 @@ /* - * We currently support two types of shared-invalidation messages: one that - * invalidates an entry in a catcache, and one that invalidates a relcache - * entry. More types could be added if needed. The message type is - * identified by the first "int16" field of the message struct. Zero or - * positive means a catcache inval message (and also serves as the catcache - * ID field). -1 means a relcache inval message. Other negative values - * are available to identify other inval message types. + * We currently support three types of shared-invalidation messages: one that + * invalidates an entry in a catcache, one that invalidates a relcache entry, + * and one that invalidates an smgr cache entry. More types could be added + * if needed. The message type is identified by the first "int16" field of + * the message struct. Zero or positive means a catcache inval message (and + * also serves as the catcache ID field). -1 means a relcache inval message. + * -2 means an smgr inval message. Other negative values are available to + * identify other inval message types. * - * Relcache invalidation messages usually also cause invalidation of entries - * in the smgr's relation cache. This means they must carry both logical - * and physical relation ID info (ie, both dbOID/relOID and RelFileNode). - * In some cases RelFileNode information is not available so the sender fills - * those fields with zeroes --- this is okay so long as no smgr cache flush - * is required. - * - * Shared-inval events are initially driven by detecting tuple inserts, + * Catcache inval events are initially driven by detecting tuple inserts, * updates and deletions in system catalogs (see CacheInvalidateHeapTuple). * An update generates two inval events, one for the old tuple and one for * the new --- this is needed to get rid of both positive entries for the @@ -71,20 +65,22 @@ typedef struct int16 id; /* type field --- must be first */ Oid dbId; /* database ID, or 0 if a shared relation */ Oid relId; /* relation ID */ - RelFileNode physId; /* physical file ID */ - - /* - * Note: it is likely that RelFileNode will someday be changed to - * include database ID. In that case the dbId field will be redundant - * and should be removed to save space. - */ } SharedInvalRelcacheMsg; +#define SHAREDINVALSMGR_ID (-2) + +typedef struct +{ + int16 id; /* type field --- must be first */ + RelFileNode rnode; /* physical file ID */ +} SharedInvalSmgrMsg; + typedef union { int16 id; /* type field --- must be first */ SharedInvalCatcacheMsg cc; SharedInvalRelcacheMsg rc; + SharedInvalSmgrMsg sm; } SharedInvalidationMessage; |
