Skip to content

Let the sweep leave what the append-only ledger holds - #328

Open
vladmesh wants to merge 1 commit into
mainfrom
stand/sweep-respects-append-only
Open

Let the sweep leave what the append-only ledger holds#328
vladmesh wants to merge 1 commit into
mainfrom
stand/sweep-respects-append-only

Conversation

@vladmesh

Copy link
Copy Markdown
Owner

Found by running the sweep on the stand after the previous fix: ERROR: engineering_attempt_ledger is append-only.

The ledger's immutability is a database rule and a deliberate one (services/api/tests/service/test_engineering_attempt_ledger.py asserts it). The previous commit tried to delete from it to clear the way for deleting the test user — the database was right to refuse.

The test user is a fixture every run reuses rather than residue of one, so it is now deleted only while nothing references it. That matters because a failing database phase does not degrade the sweep, it raises: every later phase went unrun and left its residue behind.

The attempt ledger is append-only by a database rule, and the rule is
deliberate — deleting from it is refused, and the fix that tried to was wrong.

The synthetic test user is a fixture every run reuses, not residue of one, so it
is deleted only while nothing references it. Deleting it unconditionally made
the whole sweep raise, and a raising sweep is not a partial sweep: every phase
after the database went unrun, and the residue those phases would have removed
stayed on the stand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant