Repository navigation
feat(api): delete a dataset or purge an org, with a grace period, revoked keys and an audit row (#544) - #1389
Merged
Merged
Conversation
…oked keys and an audit row (#544) DELETE /v1/orgs/{org}/datasets/{ds} (admin) and DELETE /v1/orgs/{org} (operator) flip the row to purging, after which every tenant route 404s it, and queue a purge job that may not be claimed before the grace period ends (ER_PURGE_GRACE_HOURS, default 7 days; the claim already honours not_before). An org purge revokes every key at request time. Both write an audit row and answer 202 with the job and purge_after. The jobs (dataset_purge, org_purge) are control tasks, since they open no lake. They remove what provisioning created, read from the dataset's own env. Local mode removes the data dir, catalog file and sidecars, config and the dataset's directory. Postgres mode drops the DuckLake metadata schema, deletes the S3 data prefix (refusing an empty prefix), and for an org drops the catalog database. Each job refuses a row that is no longer purging, so cancelling within the grace period withdraws the request. The default dataset is refused (it goes with its org). An operator still sees a purging org through GET. New statements: job/create/enqueue_deferred, api_key/update/ revoke_all_for_org. pg_purge proves the local path end to end: data exists, DELETE 404s it at once, the job removes the data and directory, the default dataset is refused, the real grace holds a job for a week, a tenant admin cannot purge the org, keys stop working at once, the workspace is removed, and both actions are audited. Deployed-platform purge (profile + S3 grant) is #1380. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 29, 2026 04:37 — with
GitHub Actions
Inactive
2 tasks
This branch was previously deployed
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.
Closes #544
What
Two routes:
DELETE /v1/orgs/{org}/datasets/{ds}(admin).DELETE /v1/orgs/{org}(operator).Each flips the row to
purging, after which every tenant route 404s it. Each queues a purge job that may not be claimed before the grace period ends (ER_PURGE_GRACE_HOURS, default 7 days, vianot_before). An org purge revokes every key at request time. Both write an audit row and answer 202 withjob_idandpurge_after.The
dataset_purgeandorg_purgejobs are control tasks that remove what provisioning created:DROP SCHEMA … CASCADEon the DuckLake metadata schema, delete the S3 prefix (an empty prefix is refused), andDROP DATABASEfor an org.Why
#544: customer data deletion and offboarding had no path at all. Decisions: dataset delete is a customer admin action; org purge is operator-only; the grace period is 7 days; the default dataset is refused because it goes with its org; an operator still sees a
purgingorg. A job refuses a row that is no longerpurging, so cancelling within the grace period withdraws the request.Proof
make checkexit 0. Newpg_purge(real Postgres, real executor, local mode):not_beforefor at least 6 days;purging, and the job removes the org workspace;New statements:
job/create/enqueue_deferredandapi_key/update/revoke_all_for_org.Risk & rollback
Additive routes and statements; nothing existing changes behaviour except that
purgingrows 404. Postgres mode is written but unexercised: on the deployed platform the job refuses because there is no provisioning profile and no S3 delete grant (#1380). Rollback:git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-29T05:06:10Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not: — 7c43aea, rust 46225620713 + frontend 46225620710 success
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 46225620712
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — run 46225900472 success
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra, devcontainer, marketing preview success on 7c43aea
Donethrough the automation rather than byhand, and the issue closed: — Purge a dataset or tenant through the API: drop its lake and data, revoke its keys #544 CLOSED by feat(api): delete a dataset or purge an org, with a grace period, revoked keys and an audit row (#544) #1389 via automation
(a skill, a reference, memory) — or nothing new was learned: — launch-readiness.md states the deletion boundary; a purging row 404s everywhere a tenant resolves it
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
The interval cast in
enqueue_deferred(make_interval(secs => $x::bigint)) is the same class of bug as #1383. The analyser gap is #1384.🤖 Generated with Claude Code