mirror of https://github.com/citusdata/citus.git
Merge pull request #1681 from citusdata/fix_metadata_cache
Invalidate worker and group ID cache in maintenance daemonpull/1641/head^2
commit
03bddcbfab
|
@ -281,7 +281,7 @@ CitusMaintenanceDaemonMain(Datum main_arg)
|
||||||
* this causes us to cache a stale pg_dist_node OID. We'd actually expect
|
* this causes us to cache a stale pg_dist_node OID. We'd actually expect
|
||||||
* all invalidations to arrive after obtaining a lock in LockCitusExtension.
|
* all invalidations to arrive after obtaining a lock in LockCitusExtension.
|
||||||
*/
|
*/
|
||||||
ClearMetadataOIDCache();
|
InvalidateMetadataSystemCache();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform Work. If a specific task needs to be called sooner than
|
* Perform Work. If a specific task needs to be called sooner than
|
||||||
|
|
|
@ -2713,18 +2713,21 @@ InvalidateDistRelationCacheCallback(Datum argument, Oid relationId)
|
||||||
*/
|
*/
|
||||||
if (relationId != InvalidOid && relationId == MetadataCache.distPartitionRelationId)
|
if (relationId != InvalidOid && relationId == MetadataCache.distPartitionRelationId)
|
||||||
{
|
{
|
||||||
ClearMetadataOIDCache();
|
InvalidateMetadataSystemCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ClearMetadataOIDCache resets all the cached OIDs and the extensionLoaded flag.
|
* InvalidateMetadataSystemCache resets all the cached OIDs and the extensionLoaded flag,
|
||||||
|
* and invalidates the worker node and local group ID caches.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ClearMetadataOIDCache(void)
|
InvalidateMetadataSystemCache(void)
|
||||||
{
|
{
|
||||||
memset(&MetadataCache, 0, sizeof(MetadataCache));
|
memset(&MetadataCache, 0, sizeof(MetadataCache));
|
||||||
|
workerNodeHashValid = false;
|
||||||
|
LocalGroupId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ extern List * DistTableOidList(void);
|
||||||
extern List * ShardPlacementList(uint64 shardId);
|
extern List * ShardPlacementList(uint64 shardId);
|
||||||
extern void CitusInvalidateRelcacheByRelid(Oid relationId);
|
extern void CitusInvalidateRelcacheByRelid(Oid relationId);
|
||||||
extern void CitusInvalidateRelcacheByShardId(int64 shardId);
|
extern void CitusInvalidateRelcacheByShardId(int64 shardId);
|
||||||
extern void ClearMetadataOIDCache(void);
|
extern void InvalidateMetadataSystemCache(void);
|
||||||
|
|
||||||
extern bool CitusHasBeenLoaded(void);
|
extern bool CitusHasBeenLoaded(void);
|
||||||
extern bool CheckCitusVersion(int elevel);
|
extern bool CheckCitusVersion(int elevel);
|
||||||
|
|
Loading…
Reference in New Issue