Skip to main content
Snapshot retention cleans up old snapshot-processing artifacts and Pinot segments for StarTree Iceberg/S3 tables that use ExternalTableSyncTask. Retention keeps a bounded list of active snapshots, preserves the current in-progress snapshot, deletes Pinot segments no longer referenced by retained snapshots, and sweeps old orphan snapshot artifact directories.

What retention manages

Snapshot-processing ingestion writes artifacts under a snapshot directory. A snapshot directory can contain:
  • final.parquet, the merged file for a completed snapshot.
  • Batch Parquet files under batches/ for in-progress work.
  • Auxiliary files such as deletion-vector index artifacts.
Retention uses the active snapshot list and the current watermark to decide what is still live.

Configure retention

Configure retention on the external table’s ExternalTableSyncTask config.

Retention properties

Snapshot artifacts live under each component’s deep-store root at snapshots/<tableNameWithType>/<snapshotId>/ — derived from controller.data.dir (controller), pinot.server.instance.segment.store.uri (server), and pinot.broker.data.dir (broker). The earlier iceberg.snapshotProcessing.snapshotDirURI override has been removed; if an old table config still carries it, it is ignored.
Controller-level scheduling is managed by StarTree:
In StarTree Cloud, controller-level retention cadence is managed by StarTree. Per-table retention properties are the normal user-facing controls.

Cleanup flow

Each retention run does the following for eligible external tables:
  1. Reads the current Pinot ideal-state segment set.
  2. Reads the current ingestion watermark to find an in-progress snapshot, if any.
  3. Reads the active snapshot list.
  4. Evicts oldest active snapshots until the list has at most maxActiveVersions entries.
  5. Builds a keep set from surviving snapshots’ final.parquet files and in-progress batch files.
  6. Deletes Pinot segments not present in the keep set, using deletedSegmentRetention.
  7. Sweeps orphan snapshot directories older than the oldest surviving snapshot.
This ordering protects snapshots that complete while retention is running and avoids deleting segments needed by an in-progress snapshot.

Verify retention behavior

Use the observability APIs to check the current watermark and snapshot artifacts. The checkpointValue field in the status endpoint response is the current watermark.
For a completed retained snapshot, finalParquet should be available:
For an evicted or swept snapshot, the same endpoint returns 404:

Choosing retention values

Operational guidance

  • Do not disable retention indefinitely on high-volume external tables; snapshot-processing artifacts can grow quickly.
  • Keep maxActiveVersions high enough to cover your operational rollback and audit window.
  • Keep deletedSegmentRetention aligned with incident response. A very short value can make rollback harder after an accidental eviction.
  • If retention logs report missing or corrupt final.parquet for a retained snapshot, the run skips pruning for that table and retries on the next tick.
  • If finalParquet returns 404 for a recent snapshot, check the checkpoint state. It may still be IN_PROGRESS, FAILED, or already evicted by retention.