Register cache invalidation callback before version checks

With this commit we start to register InvalidateDistRelationCacheCallback
function as cache invalidation callback function before version checks
because during version checks we use cache to look up relation ids of some
relations like pg_dist_relation or pg_dist_partition_logical_relid_index
and we want to know about cache invalidation before accessing them.
pull/1492/head
Burak Yucesoy 2017-05-23 19:03:48 +03:00 committed by Jason Petersen
parent 5b300a7aa9
commit 52b056c301
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
1 changed files with 5 additions and 5 deletions

View File

@ -511,6 +511,11 @@ LookupDistTableCacheEntry(Oid relationId)
return NULL;
}
if (DistTableCacheHash == NULL)
{
InitializeDistTableCache();
}
/*
* If the version is not known to be compatible, perform thorough check,
* unless such checks are disabled.
@ -538,11 +543,6 @@ LookupDistTableCacheEntry(Oid relationId)
}
}
if (DistTableCacheHash == NULL)
{
InitializeDistTableCache();
}
cacheEntry = hash_search(DistTableCacheHash, hashKey, HASH_ENTER, &foundInCache);
/* return valid matches */