pub async fn hydrate_attributes(
conn: &Connection,
node_ids: &[String],
as_of: &AsOf,
mode: AttributeMode,
) -> Result<Vec<NodeAttributes>>Expand description
Hydrate attributes for a list of node IDs based on the specified AttributeMode (§5.2).
Retirement is uniform across the three readers as of Wave 1 (defect AB).
The rule is the one AttributeMode::Current and
crate::temporal::reconstruct
already followed and AtTime did not: a concept retired as of the instant
being asked about is not returned. Retirement is the application axis (§4.1)
and a temporal read shows what was visible, so the three modes now disagree
about which text they return and agree about which concepts exist. Before
this, AtTime read the payload and never looked at retired, so it returned
concepts retired long before ts — the one reader that consulted the ledger
most faithfully was also the one that answered the visibility question wrong.
Note what “as of ts” means for each: Current asks whether the concept is
retired now and AtTime asks whether it was retired then. That is not an
inconsistency, it is the two clocks — and it is why Current on a historical
query is worth objecting to. That objection is no longer made here
(T3.2, D-085): this function receives the mode as a parameter and has no way
to tell a historical query from a live one, so it does what it is told.
crate::graph::TraversalBuilder is the layer that knows, and it raises
DbError::AttributeModeUnstated.
Both modes issue one query per chunk of HYDRATE_CHUNK ids, not one
per node (defect AE). Results come back in node_ids order regardless of the
order the rows arrive in, because a graph read that permuted its own output
between runs would break the property suite’s equality comparisons for a
reason that has nothing to do with the property under test.
§ts: &str became as_of: &AsOf in 0.13.2 (W7.1, D-174)
The old parameter was one instant read on whichever clock the mode happened
to use — Current ignored it, AtTime compared it to recorded_at, and
neither ever compared it to a concept’s own valid interval. So AtTime
returned concepts whose validity had ended before the instant asked about,
which is the smaller half of what §3.1
names and was recorded in TraversalBuilder::as_of’s rustdoc in 0.12.17.
AttributeMode::AtTime now dispatches on which axes are fixed:
as_of | reads |
|---|---|
| neither | live concepts, retired filtered — identical to Current |
valid | live concepts, bounded by the row’s own valid interval |
recorded | the payload believed at that instant |
| both | the payload believed then, bounded by the validity it recorded |
AttributeMode::Current ignores both axes by definition — it is the
stated choice to read live text under a historical topology, which
TraversalBuilder makes the caller make rather than fall into (D-085).
§Errors
DbError::RecordedInstantUnreachable when as_of.recorded is set under
AttributeMode::AtTime and rows have been archived out of the hot log
(0.13.16, W9.1, D-189).
Only the recorded row of the table above can raise it; the other three
read live concepts and never the log, so an archive cannot shorten them.