Describe the bug
LocalPolarisMetaStoreManagerFactory.purgeRealms() removes entries from sessionSupplierMap and metaStoreManagerMap but does not remove the corresponding entry from entityCacheMap.
|
|
|
sessionSupplierMap.remove(realm); |
|
metaStoreManagerMap.remove(realm); |
|
} |
This means after a realm is purged and re-bootstrapped, getOrCreateEntityCache() returns the stale cache from the previous realm lifecycle — containing references to entities that no longer exist.
Additionally, purgeRealms is not synchronized, unlike the other map-mutating methods (bootstrapRealms, getOrCreateMetaStoreManager, getOrCreateSession), creating a potential race with
concurrent reads/writes to the shared maps.
To Reproduce
No response
Actual Behavior
Returns stale entires post rebootstrap
Expected Behavior
should return fresh entries after bootstrap
Additional context
No response
System information
No response
Describe the bug
LocalPolarisMetaStoreManagerFactory.purgeRealms()removes entries fromsessionSupplierMapandmetaStoreManagerMapbut does not remove the corresponding entry fromentityCacheMap.polaris/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
Lines 136 to 139 in 6382476
This means after a realm is purged and re-bootstrapped,
getOrCreateEntityCache()returns the stale cache from the previous realm lifecycle — containing references to entities that no longer exist.Additionally,
purgeRealmsis notsynchronized, unlike the other map-mutating methods (bootstrapRealms,getOrCreateMetaStoreManager,getOrCreateSession), creating a potential race withconcurrent reads/writes to the shared maps.
To Reproduce
No response
Actual Behavior
Returns stale entires post rebootstrap
Expected Behavior
should return fresh entries after bootstrap
Additional context
No response
System information
No response