ayushtkn opened a new issue, #4801:
URL: https://github.com/apache/polaris/issues/4801

   ### Describe the bug
   
    `LocalPolarisMetaStoreManagerFactory.purgeRealms()` removes entries from 
`sessionSupplierMap` and `metaStoreManagerMap` but does not remove the 
corresponding entry from `entityCacheMap`. 
   
   
https://github.com/apache/polaris/blob/638247647c27667697675df01d2163043121e656/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java#L136-L139
   
   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_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to