When a CatalogInfo is explicitly evicted in CachingCatalogFacade, due to a local mutating operation, or in reaction to remote event, any oher CatalogInfo that directly (e.g. StyleInfo->WorkspaceInfo), or indirecly (e.g. LayerInfo->ResourceInfo->StoreInfo->WorkspaceInfo) references the evicted object needs to also be evicted, in order to prevent stale object references being cached.
Previously, a multi-map of such references was maintained as a reverse index. But it had a bug where for example, renaming a workspace wouldn't evict the styles for that workspace. Additionally, it could lead to memory leaks.
This patch replaces it by partial traversal of the cache entries (see CachedReferenceCleaner), and fixes both issues.
The performance penalty is sub-millisecond to < 10ms on a large catalog (100k layers, 100k styles, 20k stores, 20k workspaces).
When a
CatalogInfo
is explicitly evicted inCachingCatalogFacade
, due to a local mutating operation, or in reaction to remote event, any oherCatalogInfo
that directly (e.g.StyleInfo->WorkspaceInfo
), or indirecly (e.g.LayerInfo->ResourceInfo->StoreInfo->WorkspaceInfo
) references the evicted object needs to also be evicted, in order to prevent stale object references being cached.Previously, a multi-map of such references was maintained as a reverse index. But it had a bug where for example, renaming a workspace wouldn't evict the styles for that workspace. Additionally, it could lead to memory leaks.
This patch replaces it by partial traversal of the cache entries (see CachedReferenceCleaner), and fixes both issues.
The performance penalty is sub-millisecond to < 10ms on a large catalog (100k layers, 100k styles, 20k stores, 20k workspaces).