geyanggang commented on PR #15074: URL: https://github.com/apache/gravitino/pull/15074#issuecomment-6980539850
> Needs more fixes > > The shadowing lifecycle and rejection paths have substantial test coverage, but the new static thread-local can leak a shadowing decision into another session. That session-isolation defect should be fixed before merge. > > [P2] After `DROP CATALOG IF EXISTS` on an unaccessed Gravitino catalog, `contains()` leaves this static thread-local populated even though the operation has finished. A subsequent same-named Gravitino-managed catalog creation in another `TableEnvironment` with an ordinary Flink catalog store can consume that marker and fail incorrectly. Please scope the factory check to the originating session/operation rather than matching only the catalog name, and add a regression test using two environments on the same thread. Thanks, confirmed and fixed in b81e8c7. A left-over marker is now only honored by a factory whose session configuration enables shadowing, and by storeCatalog() of the store that recorded it; the store is weakly referenced. Flink exposes no shared session object between the catalog store and catalog factories, but every catalog instantiation path in 1.19–2.2 (CatalogManager create/alter/getCatalog and the SQL Gateway SessionContext) calls the session's store first, which resets the marker. Added testShadowing_leftOverCheck_doesNotAffectAnotherSessionOnTheSameThread, which uses two environments on the same thread with a real CatalogManager and fails without the fix. -- 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]
