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

   ### What changes were proposed in this pull request?
   
   This PR makes `CatalogManager.loadCatalogAndWrap` detect a cached 
`CatalogWrapper` whose underlying catalog has already been closed. When that 
happens, it invalidates the stale cache entry and reloads the wrapper from the 
entity store.
   
   It also adds a regression test that verifies `dropCatalog` can proceed after 
the cache contains a closed wrapper.
   
   ### Why are the changes needed?
   
   A closed `CatalogWrapper` sets its internal catalog reference to null. If a 
later `dropCatalog` call reuses that wrapper from cache, it can fail with a 
NullPointerException when checking catalog state or capabilities.
   
   Fix: #11406
   
   ### Does this PR introduce _any_ user-facing change?
   
   No user-facing API or property changes.
   
   ### How was this patch tested?
   
   ```bash
   ./gradlew :core:test --tests 
org.apache.gravitino.catalog.TestCatalogManager.testDropCatalogReloadsClosedCachedWrapper
 -PskipWeb=true -PskipDockerTests=true
   ./gradlew :core:test --tests org.apache.gravitino.catalog.TestCatalogManager 
-PskipWeb=true -PskipDockerTests=true
   git diff --check
   ```


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