retained
def retained(mut db: State, dataset: String) -> List[Int64] The snapshots of dataset orca still needs (see the module doc).
orca.expirySnapshot expiry, the scheduler's half: what orca still needs of a dataset's history, and the binary that does the expiring.
Expiring needs iceberg, which the orca binary doesn't link, so it runs in
the project's orca_maintain binary (orca.maintain). This side decides
what must survive whatever the table's policy says, from Postgres:
resume scans the snapshot the first attempt read,
so a queued, running, deferred or failed run keeps every snapshot its
attempts read. (A failed run can be resumed; a succeeded or cancelled one
can't, and is let go.)orca.tables.find_commit); one that was expired would be committed a
second time.What expiry costs: orca lineage and the UI's dataset and snapshot pages
read Postgres only, so they still show an expired snapshot, what made it
and what it was made from; but the snapshot itself is gone from the table,
so it can no longer be read (time travel, use_snapshot), and a rebuild
reruns the pipelines from the current data, not from it.
retaineddef retained(mut db: State, dataset: String) -> List[Int64] The snapshots of dataset orca still needs (see the module doc).
expirabledef expirable(mut db: State) -> List[String] Every dataset orca has committed to, by name.
maintain_binarydef maintain_binary() -> String $ORCA_MAINTAIN, else orca_maintain beside this binary, else on PATH; empty when there is none.
expire_argvdef expire_argv(mut db: State, binary: String, dataset: String, older_than: String = "", keep: String = "", dry_run: Bool = False, report: Bool = False) -> List[String] The orca_maintain expire command line for dataset: the policy given, or the table's own (--if-policy, so a table without one is left alone), and --retain with what orca still needs.
comptime MAINTAIN_BINARY = String("orca_maintain")