Reconstructs what a subject looked like at a point in history.
What is stored per change is a FIELD DELTA, not a whole value - a body rewrite costs 297 bytes
rather than 2,211 - so a value at time T is the accumulation of every change up to T rather than
a single object to fetch. That is the trade the whole storage model rests on, and this is where
it is paid back.
The walk runs from the nearest base anchor forward to the target, which is what bounds it: an
anchor is a commit a replay may start at, so history before one is never read. Until compaction
has produced anchors, the only anchor is the root and a replay covers the whole chain; the report
carries the depth either way, so a restore's cost is visible rather than assumed.
Nothing is invented. A version that cannot be read is recorded as unreadable and the fields it
carried are left out, which is what makes the result DEGRADED rather than a plausible-looking
complete value. A caller that writes a degraded result over a live one has turned a recovery into
a second incident, so ReplayResult says which it is and Preflight decides.
Manifests already read in this pass, keyed by object key.
A replay of many subjects at one commit reads each segment once rather than once per subject,
which is the difference between one pass and one pass per subject over the same objects.
Reconstructs several subjects at a commit in one pass.
Parameters
list
$subjects
Subject paths.
string
$commit
Commit id to reconstruct at.
Returns
array
—
Subject path keyed to its result.
subjectsAt()
subjectsAt(string $commit) : list<string>
Every subject a commit covers.
The anchor a commit names is a complete index at the moment the anchor was written, which is at
or before the commit. So the set is the anchor's index plus whatever the commits since have
touched: a subject created after the anchor appears in no anchor yet, and one deleted after it
is still listed by the anchor and has to come out.
Collects a line per version that could not be read. A segment that will not read loses every
subject in it, so the loss is recorded under the empty key against the commit rather than
being silently skipped.
Returns
\Drupal\strata\Segment\SegmentManifest|null
—
The manifest, or NULL when the commit sealed none or it would not read.
Folds one operation into a subject's accumulating state.
A create or update merges its field delta over what is there; a delete resets the subject to
absent, so a later create starts clean rather than inheriting fields from before the delete.
Parameters
string
$commit
Commit the operation came from, for the unreadable line.
string
$subject
Subject path.
\Drupal\strata\Journal\JournalOp
$operation
The operation.
\Drupal\strata\Segment\SegmentManifest
$manifest
The manifest it came from, which holds the frame map for its payload.
array>
$fields
Accumulating field sets, keyed by subject.
array
$exists
Whether each subject exists as of the operation.
array
$versions
How many versions have been applied per subject.
array>
$unreadable
Collects a line per version that could not be read.