kitoha opened a new pull request, #10400:
URL: https://github.com/apache/gravitino/pull/10400

   Title:
   [#ISSUE] fix(stats): Close replaced dataset cache entries
   
   ### What changes were proposed in this pull request?
   
   Switched the Caffeine cache listener to a removal listener so that replaced 
Dataset entries are closed, not just evicted ones. Added a unit test that 
verifies the old Dataset is closed when the cache entry is replaced.
   
   ### Why are the changes needed?
   
   With dataset caching enabled, calling cache.put on an existing key replaces 
the cached Dataset. Caffeine treats this as a removal (not an eviction), so the 
eviction listener does not run and the old Dataset remains open, leaking 
native/file handles during repeated statistics updates.
   
   Fix: #10326(issue)
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. There are no changes to user-facing APIs or configuration keys.
   
   ### How was this patch tested?
   
   Added a unit test: 
TestLancePartitionStatisticStorage#testDatasetCacheReplacementClosesOldDataset.
   


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