You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Iceberg remove_orphan_files with a recent older_than deletes an in-flight INSERT's files; the INSERT succeeds and the table is unreadable #125331
bugConfirmed user-visible misbehaviour in official releasecomp-icebergApache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti...minorPriority: minor
An INSERT into an Iceberg table writes its data files, manifest and manifest list before it commits the new metadata. If ALTER TABLE ... EXECUTE remove_orphan_files(older_than = <recent time>) runs in that window, it deletes those files. The INSERT then commits and returns success, and from then on every query on the table fails with FILE_DOESNT_EXIST. The table stays broken until someone repairs the metadata by hand.
Two things together make this a silent, permanent data loss:
older_than has no minimum. Spark's remove_orphan_files refuses intervals under 24 hours unless explicitly overridden, and Trino refuses anything under iceberg.remove-orphan-files.min-retention, 7 days by default.
The INSERT does not check that its own files still exist before it commits metadata that references them.
With the default older_than (3 days, iceberg_orphan_files_older_than_seconds) the same sequence is safe.
I opened #125376: remove_orphan_files now rejects an older_than less than iceberg_orphan_files_min_retention_seconds (default 1 day, 0 disables) before now, for an explicit older_than, the setting-derived one, and dry_run. Your failpoint sequence is refused with BAD_ARGUMENTS and the table keeps both rows. I did not add the pre-commit existence check in the INSERT: a sweep can still delete the files right after it.
Your #125329 passes older_than = now in 05366/05371, so whichever PR lands second needs iceberg_orphan_files_min_retention_seconds = 0 there.
bugConfirmed user-visible misbehaviour in official releasecomp-icebergApache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti...minorPriority: minor
Activity
zlareb1 commentedon Oct 12, 2026
@groeneai
groeneai commentedon Oct 12, 2026
Acknowledged. I'm investigating
remove_orphan_filesdeleting the files of an in-flight INSERT; I'll follow up here with a PR (or my findings) shortly.groeneai commentedon Oct 12, 2026
I opened #125376:
remove_orphan_filesnow rejects anolder_thanless thaniceberg_orphan_files_min_retention_seconds(default 1 day,0disables) before now, for an explicitolder_than, the setting-derived one, anddry_run. Your failpoint sequence is refused withBAD_ARGUMENTSand the table keeps both rows. I did not add the pre-commit existence check in the INSERT: a sweep can still delete the files right after it.Your #125329 passes
older_than = nowin05366/05371, so whichever PR lands second needsiceberg_orphan_files_min_retention_seconds = 0there.Iceberg: refuse a remove_orphan_files older_than closer to now than a…