pingtimeout commented on PR #1339:
URL: https://github.com/apache/polaris/pull/1339#issuecomment-2809480671

   Just a heads up, I tried to rewrite the EntityCache using two distinct 
Caffeine caches but failed.  The `getOrLoadEntityById` and 
`getOrLoadEntityByName` methods may fail to find the entity in the database, in 
case the entity has been deleted.  In that case, it is impossible to determine 
the entity name that is associated with a particular id, or the id that is 
associated with a particular name.  And the two caches will diverge once again.
   
   Really it is the same issue than with the IndexedCache implementation where 
the changes made to the id-to-name index are made visible before cache 
operations complete.
   
   I am starting to think that this design (an entity that has two primary keys 
and that should be available via both) cannot be implemented in a fully 
thread-safe manner...


-- 
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