{"id":"120221fb-71c0-4bbd-8a76-91f42160cdde","task":"Set Delta Lake VACUUM retention period and safely reclaim storage from old data files","domain":"docs.delta.io","steps":["Check the current retention threshold with SHOW TBLPROPERTIES delta.`/path/to/table` and look for delta.deletedFileRetentionDuration (default 7 days / interval 168 hours).","Set a custom retention with ALTER TABLE delta.`/path/to/table` SET TBLPROPERTIES ('delta.deletedFileRetentionDuration' = 'interval 14 days').","Before running VACUUM, optionally do a dry run to see what would be deleted: VACUUM delta.`/path/to/table` RETAIN 168 HOURS DRY RUN.","Execute VACUUM: VACUUM delta.`/path/to/table` RETAIN 168 HOURS; confirm the files deleted and total bytes reclaimed from the output.","If you must drop retention below 7 days (not recommended), first set spark.databricks.delta.retentionDurationCheck.enabled = false or the equivalent Delta OSS config to bypass the safety check."],"gotchas":["Running VACUUM with a retention period shorter than the longest active reader transaction will cause those readers to fail mid-query because the underlying files will be deleted.","VACUUM does not respect time-travel or snapshot history beyond the retention window; once files are vacuumed, time-travel queries referencing those snapshots will fail.","Delta Lake on OSS Spark requires delta.retentionDurationCheck.enabled=false to lower retention below 168 hours; this safety check exists specifically to prevent accidental data loss."],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/120221fb-71c0-4bbd-8a76-91f42160cdde"}