mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-19 20:24:46 +08:00
Fix logic for when entire cache is invalidated
Sometimes postgres wants to invalidate the entire cache. In this case it send a cache invalidation message with relid == InvalidOid. This should invalidate all the caches. Previously, it did not effect the cache of the extension state. This fixes that problem and creates one cache reset code path for both extension dropping and whole-cache reset, cleaning up some of the logic in the process.
This commit is contained in:
parent
d1dd911a62
commit
e87bc774d7
@ -49,21 +49,21 @@ inval_cache_callback(Datum arg, Oid relid)
|
||||
if (!extension_is_loaded())
|
||||
return;
|
||||
|
||||
if (extension_is_being_dropped(relid))
|
||||
if (!OidIsValid(relid) || extension_is_being_dropped(relid))
|
||||
{
|
||||
/* Extension was dropped. Reset state. */
|
||||
/* Extension was dropped or entire cache invalidated. Reset state. */
|
||||
hypertable_cache_invalidate_callback();
|
||||
chunk_cache_invalidate_callback();
|
||||
extension_reset();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!OidIsValid(relid) || relid == catalog_get_cache_proxy_id(catalog, CACHE_TYPE_HYPERTABLE))
|
||||
if (relid == catalog_get_cache_proxy_id(catalog, CACHE_TYPE_HYPERTABLE))
|
||||
{
|
||||
hypertable_cache_invalidate_callback();
|
||||
}
|
||||
|
||||
if (!OidIsValid(relid) || relid == catalog_get_cache_proxy_id(catalog, CACHE_TYPE_CHUNK))
|
||||
if (relid == catalog_get_cache_proxy_id(catalog, CACHE_TYPE_CHUNK))
|
||||
chunk_cache_invalidate_callback();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user