yuqi1129 opened a new pull request, #13297: URL: https://github.com/apache/gravitino/pull/13297
### What changes were proposed in this pull request? Add a regression test `TestMetalakeManager#testForceDropMetalakeClosesCachedCatalogs` that uses a real `CatalogManager`, creates and loads a catalog under a metalake, force-drops the metalake and asserts that the catalog's `CatalogWrapper` is evicted from the catalog cache and closed (its catalog reference is released). `main` already force-drops child catalogs through `CatalogManager.dropCatalog` in `MetalakeManager.dropMetalake` (added as part of #12420), but nothing pinned that behaviour; `branch-1.3` lacks the logic entirely and leaks every catalog's connection pool when a metalake is dropped. The cherry-pick of this PR to `branch-1.3` carries the backport of the catalog-drop logic together with this test. ### Why are the changes needed? Dropping a metalake must release the resources of its catalogs (for example JDBC connection pools) exactly as dropping each catalog does. Without this, a metalake with many JDBC catalogs on one PostgreSQL server leaves its connections held until cache expiry or server restart. Fix: #13296 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New unit test `testForceDropMetalakeClosesCachedCatalogs` in `TestMetalakeManager`. It passes on `main` and fails on `branch-1.3` without the backported fix (the wrapper stays cached). Ran `TestMetalakeManager` and `TestCatalogManager` locally. -- 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]
