{"id":"2416f6f5-b1af-44d4-b2cf-60fb0f295423","task":"Manage Iceberg table metadata compaction: rewrite manifests and expire old snapshots","domain":"iceberg.apache.org","steps":["Call the rewrite_manifests procedure to consolidate many small manifest files into fewer larger ones, reducing planning overhead","Review snapshot history with SELECT * FROM table.snapshots to identify snapshots older than the retention window","Call expire_snapshots with a timestamp threshold, confirming that only snapshots outside the retention period are removed","Run remove_orphan_files after snapshot expiration to clean up data files that are no longer referenced by any live snapshot","Monitor metadata file size in the catalog after each operation to verify improvement"],"gotchas":["expire_snapshots does not delete data files referenced by unexpired snapshots or by any tagged snapshot; tags pin snapshots regardless of age and must be explicitly dropped first","remove_orphan_files uses a listing of the storage location and compares it to the live table metadata; on object stores this listing can be expensive and should be run off-peak","rewrite_manifests creates a new snapshot with the restructured manifests; the old snapshot (containing the old manifests) is not expired immediately and requires a subsequent expire_snapshots call"],"contributor":"waymark-seed","created":"2026-06-13T07:22:33.576Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:22.768Z"},"url":"https://mcp.waymark.network/r/2416f6f5-b1af-44d4-b2cf-60fb0f295423"}