Recover paired history insertions before exposing stored objects - #2541
Open
a-shannon wants to merge 4 commits into
Open
Recover paired history insertions before exposing stored objects#2541a-shannon wants to merge 4 commits into
a-shannon wants to merge 4 commits into
Conversation
Keep synchronization scenarios with their correction in ergoplatform#2511. Reuse the spendable sorting fixture already present in ergoplatform#2480.
a-shannon
marked this pull request as ready for review
September 9, 2026 16:28
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.
Uses shared test support from #2535. Review the history increment; the upstream diff is cumulative until the prerequisite merges.
A paired history insertion can persist an object before its indexes fail. The object's presence then prevents ordinary processing from completing those indexes. Record a durable intent, write the objects, and atomically publish indexes with intent removal. Publish caches afterward. Ordinary persistence failure makes the live instance unavailable; reopening validates and replays its recorded insertion before exposing reads.
The change adds an explicit synchronous batch API, retains existing object/index encodings, and reserves a private non-hash index key for recovery. Acquisition and initialization failures close acquired stores while preserving the original error.
The initial storage increment passed 33 tests across recovery, durable batches, journal decoding, factory cleanup and existing consumers. They cover before/after acknowledged-write outcomes, retried recovery, object identity, exact malformed-record rejection, cache publication and control-exception propagation. Independent source and evidence reviews completed.
Decoded-object caching exposed an existing header-size calculation error: a history type prefix was counted as part of the header.
HeaderSerializernow measures consumption relative to its own entry. Header bytes and IDs are unchanged. The follow-up passes 18 serialization tests and all 10 blocks API route tests, preserving full JSON equality. All eight checks, including integration, passed at223ea95c6(CI run). The earlier integration timeout is historical evidence, not a result attributed to this head.This covers recorded paired insertions, not repair of existing unjournaled orphan objects or all history mutation APIs. No OS power-loss guarantee is inferred. #2523 retains ownership of removal-error propagation. When composing with #2424, its additional index/raw-removal methods must also respect the availability boundary.