Snowflake: Avoid unbounded FileIO accumulation in SnowflakeCatalog#17096
Open
thswlsqls wants to merge 1 commit into
Open
Snowflake: Avoid unbounded FileIO accumulation in SnowflakeCatalog#17096thswlsqls wants to merge 1 commit into
thswlsqls wants to merge 1 commit into
Conversation
newTableOps() created a new FileIO per table load but always added it to the CloseableGroup, so long-lived catalog instances accumulated one FileIO per table load until the catalog itself closed. Track FileIO instances with core's FileIOTracker instead, mirroring the pattern GlueCatalog already uses for the same per-table-FileIO design. Generated-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17095
Summary
newTableOps()created a freshFileIOper table load but registered it directly withcloseableGroup, which never releases individual entries until the whole catalog closes — long-lived catalogs accumulate oneFileIOper table load indefinitely.FileIOwith core'sFileIOTrackerinstead, matchingGlueCatalog#newTableOps, which already handles the identical "new FileIO per TableOperations" design viafileIOTracker.track(...).aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java(initialize()andnewTableOps()).Testing done
TestSnowflakeCatalog#testNewTableOpsTracksFileIOPerCall, verifying a freshFileIOis tracked on everynewTableOps()call (including reloading the same table) and that all trackedFileIOinstances close when the catalog closes.TestSnowflakeCatalog#testCloseto poll for theFileIOclose, sinceFileIOTrackercloses trackedFileIOinstances via an asynchronous removal listener../gradlew :iceberg-snowflake:check— 66 tests passed, 0 failures.