Skip to content

Refuse a version chain that leads back into itself - #1262

Merged
noha merged 1 commit into
mainfrom
a-version-chain-that-circles-is-refused
Sep 16, 2026
Merged

noha merged 1 commit into
mainfrom
a-version-chain-that-circles-is-refused

Conversation

@noha

@noha noha commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

#allVersionsAt: follows previousVersionPosition until it reaches zero and keeps every version it passes. A chain that returns to a position it has already been at therefore never returns, and the collection grows until the image is gone - which is what a database in the estate did to whichever process tried to back it up, for four months, without an error anywhere.

The walk now remembers where it has been and signals SoilDatabaseIsInconsistent when it arrives there again, naming the object and the position. One damaged object then costs its own database rather than the process reading it.

Only this walker is guarded. #basicAt:version: and #at:version: follow the same links but stop at the first version they can use, so they circle only when asked for a version the cycle does not contain; this one follows the chain to its end whatever it finds.

#allVersionsAt: follows previousVersionPosition until it reaches zero and keeps
every version it passes. A chain that returns to a position it has already been
at therefore never returns, and the collection grows until the image is gone -
which is what a database in the estate did to whichever process tried to back it
up, for four months, without an error anywhere.

The walk now remembers where it has been and signals SoilDatabaseIsInconsistent
when it arrives there again, naming the object and the position. One damaged
object then costs its own database rather than the process reading it.

Only this walker is guarded. #basicAt:version: and #at:version: follow the same
links but stop at the first version they can use, so they circle only when asked
for a version the cycle does not contain; this one follows the chain to its end
whatever it finds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@noha
noha requested a review from MarcusDenker September 16, 2026 13:55
@noha
noha merged commit 48d1c5b into main Sep 16, 2026
5 checks passed
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