Skip to content

Snowflake: Avoid unbounded FileIO accumulation in SnowflakeCatalog#17096

Open
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/snowflake-catalog-fileio-tracker
Open

Snowflake: Avoid unbounded FileIO accumulation in SnowflakeCatalog#17096
thswlsqls wants to merge 1 commit into
apache:mainfrom
thswlsqls:fix/snowflake-catalog-fileio-tracker

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Closes #17095

Summary

  • newTableOps() created a fresh FileIO per table load but registered it directly with closeableGroup, which never releases individual entries until the whole catalog closes — long-lived catalogs accumulate one FileIO per table load indefinitely.
  • Track each FileIO with core's FileIOTracker instead, matching GlueCatalog#newTableOps, which already handles the identical "new FileIO per TableOperations" design via fileIOTracker.track(...).
  • Sibling code: aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java (initialize() and newTableOps()).

Testing done

  • Added TestSnowflakeCatalog#testNewTableOpsTracksFileIOPerCall, verifying a fresh FileIO is tracked on every newTableOps() call (including reloading the same table) and that all tracked FileIO instances close when the catalog closes.
  • Adjusted TestSnowflakeCatalog#testClose to poll for the FileIO close, since FileIOTracker closes tracked FileIO instances via an asynchronous removal listener.
  • ./gradlew :iceberg-snowflake:check — 66 tests passed, 0 failures.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snowflake: Avoid unbounded FileIO accumulation in SnowflakeCatalog

1 participant