Skip to content

Add Iceberg compaction and storage lifecycle to bound physical footprint #173

Open

Description

@malon64

v0.6 scope decision (2026-10-27): v0.6 #53 owns safe snapshot expiry/orphan cleanup and records maintenance limitations. This issue owns measured compaction/manifest tuning, sustained storage lifecycle policies, object count optimization, and provider cost tradeoffs, informed by #328/#329. Do not duplicate the #53 cleanup implementation.

Revised 2026-10-05 (#183): Historical 2026-10-05 plan (superseded): Moved to v0.6-alpha: the benchmark (#328) needs stable stored-bytes figures. Compaction and manifest rewrites run through Trino (optimize, optimize_manifests). Lifecycle rules are written for each provider's object store (S3, Scaleway, OVHcloud), not AWS only; the Intelligent-Tiering decision stays with the v0.10 cost work. The dependency on #164/#169 is replaced by #328.

Milestone: deferred — cost/storage optimization
Roadmap sequence: #183 (revised 2026-09-15)

Context

OpenLakeForge stores table data as Iceberg on S3 with catalog metadata in Glue. Iceberg's correctness guarantees come from retaining snapshots, manifests and data files that a naive deployment never removes. Without maintenance, a lakehouse accumulates:

  • expired snapshots and their manifest lists, retained indefinitely;
  • orphan files left by failed or interrupted writes — which elastic and Spot capacity ([Cost optimization] Add elastic EKS burst capacity for batch and query workloads #165) will make more frequent, not less;
  • small files produced by frequent incremental ingestion, which inflate both storage and the per-request and per-scan cost of every downstream query;
  • unbounded object counts that raise S3 request costs and Glue metadata operation costs.

At ~100 GB the dollar impact is small. At the 1 TB reference scenario in #169 it is material, and without maintenance the "stored physical bytes" figure that #169 must report is not a stable measurement — it is a function of how long the deployment has been running.

This is therefore both a cost issue and a prerequisite for honest benchmarking.

Goal

Give OpenLakeForge deployments a supported, scheduled table-maintenance and storage-lifecycle capability, so physical storage footprint and request cost stay bounded and predictable relative to logical data volume.

Scope

Table maintenance, as first-class platform capability rather than user-authored pipelines:

  • snapshot expiry with a configurable retention window that preserves time-travel guarantees the product actually promises;
  • orphan-file cleanup, with a safety interval long enough that in-flight writes are never removed;
  • data-file compaction / small-file rewriting, with a trigger policy based on file-count and file-size distribution rather than a fixed schedule;
  • manifest rewriting where it materially reduces planning cost;
  • alignment with the medallion layout so Bronze, Silver and Gold can carry different retention and compaction policies.

Storage lifecycle:

  • S3 lifecycle rules for the ops bucket and for non-current object versions;
  • an explicit decision on S3 Intelligent-Tiering or lifecycle transitions for cold Bronze data, including the per-object monitoring charge and the object-size threshold below which it costs more than it saves;
  • abort-incomplete-multipart-upload rules, which are a common silent leak;
  • retention policy for Dagster and platform logs written to object storage.

Measurement:

Out of scope

  • Changing the catalog or table format.
  • Query-engine tuning, which belongs with the benchmark work.
  • Customer-specific retention policy. This ships defensible defaults and makes them configurable.

Acceptance criteria

  • Snapshot expiry, orphan-file cleanup and compaction run as scheduled, supported platform maintenance with configurable policy.
  • Retention defaults preserve whatever time-travel guarantee the product documents, and that guarantee is stated explicitly.
  • Orphan-file cleanup uses a safety interval that cannot remove in-flight writes, and this is verified against an interrupted write.
  • Compaction is triggered by measured file-count and size distribution rather than a fixed schedule alone.
  • Per-layer retention and compaction policy is configurable through deployment configuration.
  • S3 lifecycle rules exist for non-current versions, incomplete multipart uploads and the ops bucket.
  • An Intelligent-Tiering / transition decision is documented with the object-size threshold that justifies it.
  • Physical bytes, object count and file-size distribution are reported per layer in machine-readable form.
  • A sustained-ingestion test shows physical footprint stays bounded relative to logical volume across repeated runs.
  • Maintenance is verified not to corrupt or invalidate concurrent reads.

Dependency and sequencing

Depends on #164 only for the reference workload definition. It should land before #169, because #169 cannot report stable stored-bytes figures without it, and before or alongside #165, whose interruption behavior increases orphan-file production.

Scope boundary after beta reorganization

#53 owns beta snapshot retention/expiry and orphan cleanup. Reuse that implementation and its safety guarantees. This post-beta issue owns compaction/manifest tuning, advanced S3 lifecycle decisions and physical-footprint benchmarking; it must not duplicate #53 or make beta depend on #164/#169.

Activity

  1. added
    roadmap
    priority: P1
    on Sep 3, 2026
  2. added
    track: workloads
    on Oct 5, 2026
  3. changed the title [-][Cost optimization] Add Iceberg table maintenance and S3 storage lifecycle to bound physical footprint[/-] [+]Add Iceberg compaction and storage lifecycle to bound physical footprint[/+] on Oct 5, 2026
  4. added
    priority: P2
    and removed
    priority: P1
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: P2roadmaptrack: workloadstype: feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions