Repository navigation
feat(services): erase and retain capture data in iceberg tables - #135
Merged
Merged
Conversation
TheMeinerLP
force-pushed
the
feat/iceberg-erasure
branch
from
November 18, 2026 15:45
ecdd60e to
d219d58
Compare
With CORVUS_LAKE_FORMAT=iceberg, corvus-compact now erases a player's rows from the events and raw tables and expires the snapshots that still hold them. An erasure request completes only when that succeeded. A branch or tag that keeps an older snapshot blocks the request, and the API shows the reason. corvus-housekeeping expires old snapshots and removes orphan files of the Iceberg tables; it never deletes rows. - delete the rows of the pseudonym's sessions in chunks of 1000 session ids, one commit per chunk, each tagged with the request id; commit conflicts are retried with backoff - expire every older snapshot right after the delete, then remove unreferenced files that are older than an hour - mark the dataset snapshots that list the erased sessions as needs_rebuild - add erasure_requests.lake_blocked_reason (migration 0008) and return it in the API - parquet mode is unchanged
…eeping The compaction and housekeeping CronJobs get CORVUS_LAKE_FORMAT from lake.format. With iceberg they also get the catalog, OAuth and S3 settings of the lake block, the same secrets as ingest. Housekeeping gets lake.snapshotRetentionDays (7).
Section 2a covers the erasure steps, the blocked state, the needs_rebuild mark and the retention of raw in Iceberg. Section 7 points to it and lists the open points.
TheMeinerLP
force-pushed
the
feat/iceberg-erasure
branch
from
November 18, 2026 15:50
d219d58 to
a4c38fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A player who asked for erasure was not fully erased once the lake switches to Iceberg. The
erasure request showed as done, but the player's frames stayed readable in the
eventsandrawtables: the cleanup job only knew the Parquet files.This PR closes that gap for the Iceberg mode only. Parquet mode does not change.
player's key, plus frames of the player's sessions that carry no key. The older versions of
the tables are then dropped right away, together with the files only those versions still
used. Only files that no remaining version names are deleted, so a write that is still in
progress is never touched. The data is then gone from storage, not just hidden from queries.
The request stays open and the erasure API shows why, so the hold can be found and released.
The player's rows are already out of the current data.
them.
only does it when
lake.maintenance.enabledis set (default off). Its orphan removal keeps a24 h margin.
Not in this PR
until the table is written again. The rows themselves are gone.
replica.
Testing
player's rows in both tables, removal from the data files, removal of files that an earlier
untagged delete had dropped, no removal of files no expired version named, expiry of the older
versions, refusal of a scan of an expired version, held erasure by a tag and by a branch, retry
on a commit conflict and no retry on other errors, housekeeping maintenance that removes orphans
only after 24 h and never deletes rows, and the compaction wiring with and without Iceberg.
maintenance switch (off by default).
It has not run against a live PostgreSQL in this PR.
ruff,ruff format --check,mypy src,helm unittestandhelm lintpass.Layout, the erasure steps and the open points are in
docs/reference/data-lake.md, section 2aand section 7.