Repository navigation
Fix: Reindex Rebuild Performance Regression - #1211
Conversation
Two paired fixes that together unblock first-time reindex on lambdas where a long commit chain forces `LedgerState::load` to walk every commit before the rebuild can start. ## What's wrong `LedgerState::load_novelty` walks the full chain via `trace_commits_by_id` and replays each commit's flakes through `Novelty::apply_commit`. That per-commit path runs an LSM-style two-way merge per index (4 indexes × M commits) — `O(target.len() + batch.len())` per merge accruing to `O(M·N̄)` over the chain. For a 787-commit production ledger with ~9k ops/commit this measured at ~13 minutes on a 10 GB single-vCPU lambda, exceeding the 900s reindex ceiling. The hang was silent because `apply_commit`'s progress emit lives in `fluree_db_novelty` (not in any rebuild log target), so cloudwatch saw 11+ minutes of nothing between `Loaded ledger state for queued indexing work` and a timeout — masking which phase was at fault. `BranchedContentStore` (`fluree-db-core/src/storage.rs`) implemented `get`, `has`, `put`, etc., but **not** `get_range`. The trait default falls back to `get` + slice. Branched ledgers therefore silently nullify PR #158's envelope-only byte-range probe in `load_commit_envelope_by_id` — every Phase A envelope read becomes a full-blob fetch. The blocking production case here is non-branched so this isn't its proximal cause, but it's a regression vector waiting for the next branched ledger reindex. ## What changes `fluree-db-novelty/src/lib.rs` — adds `Novelty::bulk_apply_commits`: - Routes every flake into a per-graph bucket in one ingest pass. - Sorts each graph by an identity-then-t key (`s, p, o, dt, m, t, op`) via `par_sort_unstable_by`. - Walks each `(s, p, o, dt, m)` group linearly to apply set semantics — drops an assertion only when the prior kept flake for the same identity was also an assertion (mirrors `apply_commit`'s `fact_currently_asserted_in_graph` skip rule); always keeps retractions. - Re-sorts the deduped set into the 4 index orders (SPOT/PSOT/POST/OPST) once each. Total work is `O(N log N)` regardless of how many commits the chain contains. For the 787-commit case this drops the catch-up from minutes to under ten seconds on lambda. Existing graph contents are merged into the dedup pass alongside the new batches so the post-condition matches what a sequential per-commit `apply_commit` chain would have produced. `epoch` bumps once per call. Helper functions `cmp_object`, `cmp_meta`, and `same_identity` mirror `fluree_db_core::comparator`'s private comparators so the dedup walk groups by exactly the same `(s, p, o, dt, m)` identity that `apply_commit` checks. They're file-local — no public API surface added beyond the new method itself. `fluree-db-ledger/src/lib.rs::load_novelty` — switches the deferred-batch replay loop from per-commit `apply_commit` to a single `bulk_apply_commits` call. The dict-novelty population still runs per-batch in commit order so overlay translation invariants are preserved before the bulk apply. `fluree-db-core/src/storage.rs` — implements `ContentStore::get_range` on `BranchedContentStore`. Mirrors the `get` semantics: try the branch's own store first, fall through to ancestor stores on `NotFound`. Crucially calls `get_range` on each ancestor (not the trait default fallback), so range-capable backends keep their byte- range optimization across the entire branch ancestry. ## Verification - `cargo check -p fluree-db-core -p fluree-db-novelty -p fluree-db-ledger` passes. - `cargo nextest run -p fluree-db-novelty -p fluree-db-ledger --no-fail-fast` — 62/62 pass, including the existing set-semantics tests (`test_apply_commit_skips_duplicate_assertions_across_commits`, `test_apply_commit_allows_reassert_after_retract`, `test_apply_commit_does_not_dedup_distinct_metadata`, `test_per_graph_isolation`) which exercise the dedup invariants `bulk_apply_commits` is required to preserve. End-to-end lambda validation + multi-commit perf regression test land in the next commits in this branch (orchestrator-path test asserting wall-clock budget + a streaming envelope-aware `ApiFulltextConfigProvider` that skips full novelty load when only the config graph is needed).
Skips `LedgerState::load`'s full chain walk in `ApiFulltextConfigProvider::resolve` when the ledger has never registered the config graph IRI. This is the common case on a first-ever reindex of a ledger that hasn't set up `f:fullTextDefaults` — for the regressing 787-commit production ledger this PR is built against, it removes ~30s of full-blob commit reads, zstd decompresses, and flake construction that the resolver was performing only to discover an empty config graph. ## What's wrong `ApiFulltextConfigProvider::resolve` always called `LedgerState::load`, which walks the entire commit chain via `trace_commits_by_id` and fully decodes every commit blob (`read_commit_v4`). Even with the preceding `bulk_apply_commits` work making the in-memory replay `O(N log N)` instead of `O(N²)`, that approach still pays per-commit S3 fetch + decompress + decode regardless of whether any config flake will be found. For ledgers that never wrote `f:LedgerConfig` — which the regressing production deployment had never done — that's pure waste. There is no fulltext config to discover, yet every reindex re-walks the chain and re-builds a complete novelty just to run a SPARQL pattern over a graph slot that has no triples. ## What changes `fluree-db-core/src/commit.rs` — adds `graph_delta` to the public `CommitEnvelope` struct. The binary envelope already encodes `graph_delta` (per `codec/envelope.rs:182`), but the v4 envelope reader was dropping it on the floor. Surfacing it on the public `CommitEnvelope` lets envelope-only walkers detect that a particular named graph has been registered without paying for ops decode. The v3 legacy reader returns an empty `graph_delta` since v3 never encoded this field — callers that rely on the short-circuit and may face v3 chains should fall through to a full load on `None`. `fluree-db-core/src/commit.rs` — adds `first_t_where_graph_registered<C: ContentStore>(store, head, iri)`. Walks the commit DAG using `load_commit_envelope_by_id` (byte-range ~128 KiB per commit on range-capable backends, no zstd, no flake construction), inspects each envelope's `graph_delta` for the IRI, and returns the lowest `t` where it's seen — or `None` if it never appears. Re-exported from the crate root. `fluree-db-api/src/indexer_fulltext_provider.rs::resolve` — runs the envelope-only probe before doing anything else: 1. Look up the `NsRecord` (one nameservice round-trip). 2. If `commit_head_id` is set, build the appropriate content store (branched if `source_branch` is set, flat otherwise — same shape `LedgerState::load` would have built internally). 3. Call `first_t_where_graph_registered(cs, head, config_graph_iri(ledger_id))`. 4. If `None`: log a debug breadcrumb, return an empty configured- properties list. **No `LedgerState::load`, no novelty build, no full commit reads.** 5. If `Some(_)`: log the registration `t` and fall through to the existing `LedgerState::load` + `resolve_ledger_config` path, which is itself fast now thanks to `bulk_apply_commits`. The provider's lookup-then-probe ordering avoids racing with nameservice updates and re-uses the existing `fluree_db_nameservice::build_branched_store` helper so branched ledgers see the same ancestry walk that `LedgerState::load` would have set up. ## Effect on the failing scenario Affected production reindex (787 commits, `config_id: None`, no `f:fullTextDefaults` ever committed): - Before: ~30s of full commit blob reads in `LedgerState::load_novelty` via `load_commit_by_id`/`read_commit_v4`, plus the now-O(N log N) novelty build, before the rebuild even starts. - After: ~787 byte-range envelope probes (each 128 KiB or less; on S3 these are sub-100 ms RTT), then `first_t_where_graph_registered` returns `None`, then resolve returns immediately. End-to-end well under 10s on lambda for the entire pre-rebuild step. For ledgers that DO use fulltext config (e.g. `fulltext_configured_property_first_build_via_provider` test), the envelope walk finds the registration and the existing path proceeds unchanged — but now backed by `bulk_apply_commits`, so the slow path is also fast. ## Verification - `cargo check -p fluree-db-core -p fluree-db-api` passes. - `cargo nextest run -p fluree-db-api --test it_query_fulltext --no-fail-fast` — 13/13 pass, including `fulltext_configured_property_first_build_via_provider`, `fulltext_configured_property_picked_up_by_build_index_for_ledger`, `fulltext_configured_property_indexed_after_reindex`, `fulltext_configured_incremental_adds_to_arena`, `fulltext_configured_two_commits_two_values_full_rebuild`, `fulltext_configured_langtagged_literal_scores_via_arena`. These exercise the path where the config graph IS registered (envelope walk falls through to full load) and assert the configured properties are still picked up correctly. End-to-end lambda validation + a multi-commit orchestrator-path regression test with a wall-clock budget land in the next commit.
Adds an integration test crate covering both fixes shipped earlier on
this branch (`51217f33b` novelty bulk-load + `d5e03c27d` envelope
short-circuit). The audit explicitly called out missing regression
tests as the gap that let the per-commit `apply_commit` regression
ship undetected — these tests close that gap.
## Tests
`fluree-db-api/tests/it_reindex_pre_build_perf.rs` (new):
1. **`first_t_where_graph_registered_no_full_reads_when_iri_absent`**
Deterministic counting test using a `CountingContentStore`
wrapper. Seeds 8 commits with no config-graph data, runs the new
`first_t_where_graph_registered` helper looking for the config IRI,
asserts:
- return is `None` (IRI never registered),
- `get` calls == 0 (NO full-blob fetches),
- `get_range` calls == 8 (one envelope read per commit).
Any future change that reintroduces a full-blob walk through
`load_commit_by_id` (the pre-fix shape) flips `get` non-zero and
fails the test loudly. Mirrors the structure of
`it_rebuild_fetch_counts.rs` so the convention for fetch-count
regression guards stays uniform.
2. **`first_t_where_graph_registered_returns_lowest_t_when_iri_present`**
Confirms the helper actually finds the registration. Writes a
`f:LedgerConfig` triple in the genesis commit, then 4 follow-up
non-config commits. Asserts the helper returns `Some(1)` — proving
the envelope walk surfaces the earliest registration regardless of
later commits.
3. **`orchestrator_first_reindex_no_config_completes_quickly`**
End-to-end smoke test of the orchestrator path with the AWS
wiring shape: `BackgroundIndexerWorker` started on a `LocalSet`,
`IndexerConfig::small().with_fulltext_config_provider(...)`
matching `start_background_indexing_dyn`. Seeds 200 commits on a
no-config ledger, triggers via `IndexerHandle::trigger`, waits for
`IndexOutcome::Completed`, asserts `index_t == 200` and wall-clock
under 60s.
Wall-clock budgets are necessarily soft on CI, but a regression
in either fix would push this past the budget on Lambda
single-vCPU and produce clearly-elevated runtime even on
multi-core CI hardware. The 60s ceiling is well below the 13-min
Lambda waiter timeout that motivated this branch — far enough
from the noise floor to catch egregious reintroduction of the
per-commit `O(N²)` novelty replay or the full
`LedgerState::load` chain walk on no-config ledgers.
## Verification
- `cargo fmt --all -- --check` — clean.
- `cargo clippy --workspace --all-features --all-targets -- -D warnings`
— clean.
- `cargo nextest run --workspace --all-features --no-fail-fast` —
6014/6014 tests pass (11 skipped — feature-gated S3
testcontainers paths that are run separately). Includes the 3 new
tests in `it_reindex_pre_build_perf.rs` plus the existing
`it_rebuild_fetch_counts.rs`,
`fulltext_configured_property_first_build_via_provider`,
`it_indexing_workflow.rs`, and the broader workspace coverage
unaffected by the changes on this branch.
789f00b to
870f75f
Compare
…y contract Addresses review items 1, 2, 5, and 7 on PR #1211. The v3 fix is correctness-blocking; the others are inexpensive hardening bundled into the same commit so the branch doesn't churn. ## Item 1 — v3 chains no longer silently lose fulltext config (correctness) Reviewer flagged that `first_t_where_graph_registered` returned `None` on v3 envelopes — which never encoded `graph_delta` — so a chain containing any v3 commit (mixed v3-then-v4 chains, or pure v3 chains) caused `ApiFulltextConfigProvider::resolve` to short-circuit and silently report no configured fulltext properties even when the config graph WAS registered. The PR description claimed v3 callers fell through to a full load; the code did not. **Change:** the helper now returns a tri-state `GraphRegistrationProbe { Found(t) | NotFound | Inconclusive }`. It inspects each envelope's blob version byte (header byte 4) before trusting the decoded `graph_delta`. Any v3 (or unknown future version) flips the result to `Inconclusive`, which the provider treats identically to `Found(_)`: fall through to `LedgerState::load`. Only `NotFound` short-circuits. The version inspection reuses the bytes already fetched for envelope decode — no extra round trips. Implementation factors the existing `load_commit_envelope_by_id` body into a private `load_commit_envelope_with_version` sibling that returns `(envelope, version)`; the public function is a thin wrapper that discards the version, so existing callers (CLI sync, merge, rebase, etc.) are unaffected. New regression test in `legacy_v3::tests`: `first_t_where_graph_registered_returns_inconclusive_on_v3_envelope` constructs a v3 blob via the existing `build_v3_test_blob` helper, puts it in a `MemoryContentStore`, runs the probe, and asserts `Inconclusive`. Locks in the contract that no future "simplification" can collapse v3 detection back into the `NotFound` path. ## Item 2 — Document `bulk_apply_commits` arena bloat semantics Reviewer noted that `bulk_apply_commits` pushes flakes into the `FlakeStore` arena before the dedup walk, leaving deduped duplicates in the arena and inflating `self.size` for the lifetime of the `Novelty`. Unlike `apply_commit` which dedupes BEFORE `push_with_size`. For the only call site (`load_novelty` from a fresh empty arena consumed and dropped immediately) this bloat is bounded and operationally negligible — but the contract is not the same as `apply_commit`'s and any future caller should know. **Change:** doc-comment block on `Novelty::bulk_apply_commits` explicitly contrasts the arena retention with `apply_commit`, describes the bound at the design call site, and warns against hot-path mutation use without redesigning the dedup or adding a post-walk arena rebuild. ## Item 5 — Document `first_t_where_graph_registered` cost contract Reviewer noted the helper walks the full DAG even after a hit so it can return the smallest `t` across alternate parent branches. Correct as written; just unstated in the docstring. **Change:** added a "Cost contract" section explaining why the walk is exhaustive and noting that pipelining via `buffered(K)` is a follow-up optimization (already on the PR's deferred list). ## Item 7 — Drift-guard test for novelty's local comparator helpers Reviewer noted `cmp_object`, `cmp_meta`, and `same_identity` are file-local copies of `fluree_db_core::comparator`'s private helpers, with no compile-time pin keeping them aligned. Silent drift would produce silently-dropped or duplicated assertions during first-load catch-up — extremely hard to diagnose at runtime. **Change:** new unit test `local_identity_helpers_match_core_spot_comparator_semantics` in `fluree-db-novelty::tests`. Constructs flake pairs that share or differ on each `(s, p, o, dt, m)` component plus the `(t, op)` tail, asserts `same_identity` agrees with `IndexType::Spot.compare`'s prefix behavior on every dimension, and verifies `cmp_meta` / `cmp_object` ordering matches what SPOT encodes. If either side ever drifts, the test fires loudly. ## Verification - `cargo fmt --all -- --check` clean. - `cargo clippy --workspace --all-features --all-targets -- -D warnings` clean. - `cargo nextest run --workspace --all-features --no-fail-fast` — 6016/6016 tests pass (up from 6014: +1 v3 fallthrough test, +1 comparator drift-guard test). 11 skipped (feature-gated S3 testcontainers paths run separately). - All three existing `it_reindex_pre_build_perf.rs` tests continue to pass; the no-config and with-config tests now use `GraphRegistrationProbe::NotFound` / `Found(t)` directly instead of `Option`. ## Deferred (review items 3, 4, 6, 8, 9) Item 3 (duplicate NS lookup + branched-store build on the registered-config path) — bounded perf cleanup, no Lambda budget exposure. Deferred to follow-up. Item 4 (cosmetic), item 6 (already correct), items 8 and 9 (positive feedback) — no action required
bplatz
left a comment
There was a problem hiding this comment.
When the config graph IS registered, ApiFulltextConfigProvider::resolve walks the DAG once via first_t_where_graph_registered (envelope-only), then LedgerState::load walks it again (full blobs). For the no-config case (the regressing one) this is fine — probe terminates and we return. For ledgers that DO use fulltext config it's additional latency.
The PR description defers this as item 3, but it's worth at least returning the discovered t from Found(t) so a future commit can use it as a stop_at_t hint or to seed a partial walk. Right now t is logged and discarded.
Forward-positioning comment per PR #1211 review feedback. Reviewer (@bplatz, approval comment) noted that on chains where the config graph IS registered, `ApiFulltextConfigProvider::resolve` walks the DAG once via `first_t_where_graph_registered` (envelope-only, fast) and then `LedgerState::load` walks it again via `trace_commits_by_id` (full blobs, slow). The `t` value returned from `Found(t)` is currently logged and discarded; threading it through to `LedgerState::load` as a `stop_at_t` hint, or routing config resolution behind a `g_id`-filtered novelty load, would eliminate the redundant pass. The actual optimization requires API design on `LedgerState` (a new entry point or added parameter) that doesn't fit on this PR. The `GraphRegistrationProbe::Found(t)` enum already surfaces the value publicly so a follow-up can pick it up; the only thing missing was making the future-use intent visible at the consuming match arm. This commit adds a single block comment at the `Found(t)` arm in `indexer_fulltext_provider.rs` describing the optimization shape and referencing the review note. No code change. No test change. ## Verification - `cargo check -p fluree-db-api` clean. - `cargo fmt --all -- --check` clean. ## Effect on no-config (regressing) path None — the `NotFound` arm is unchanged and continues to short-circuit without `LedgerState::load`. This commit only documents the follow-up opportunity for the registered-config path.
Added a comment in the code and made a GH issue at #1218 |
Fixes the regression that pushed first-time reindex on the large dataset indexing Lambda past the 13-minute waiter timeout repeatedly. Two stacked slowdowns were hitting any reindex of a ledger with no prior index; this PR addresses both, plus a defensive fix for branched ledgers and regression guards so neither can re-emerge silently.
Background
CloudWatch logs for a particular indexing lambda showed 787-commit reindexes of a dataset consistently timing out at 13 minutes:
read_commit_v4debug events when DEBUG was bumpedIndex trigger timed outwaits, identical retry pattern across cold startsTwo distinct regressions, both shipped via PR #1199 / commit
5985d0f01 fluree v4 baseline:Novelty::apply_commitcalled per-commit duringLedgerState::load_novelty. Themerge_batch_into_indextwo-way merge accruedO(M·N̄)over the chain. For 787 commits × ~9k ops this measured ~11 minutes on Lambda single-vCPU. Silent in logs becauseapply_commit's span lives influree_db_novelty, not in any rebuild target most filters include.ApiFulltextConfigProvider::resolvealways loaded fullLedgerState. Even when the ledger had never writtenf:LedgerConfig,resolvewalked every commit viaload_commit_by_id(read_commit_v4) just to discover the config graph was empty. ~30s of wasted full-blob reads + zstd decompresses + flake construction before the rebuild even started.The provider regression originated in fluree/db-r commit
4d6ff8fc "fulltext fixes/enahnce"on the unmergedmisc/fixesbranch (a fix for the "Solo bug report 2026-04-23" referenced influree-db-api/tests/it_query_fulltext.rs:863-868). The novelty regression has been there longer but only surfaced once the provider started forcing it on every reindex.BranchedContentStoreseparately doesn't implementget_range, so PR fluree/db-r#158's envelope-only byte-range probe falls back to full-blob fetch via the trait default for branched ledgers. The dataset-in-question's main branch isn't branched so this isn't the blocking cause for them, but it's a regression vector waiting for the next branched ledger reindex.Changes
Novelty::bulk_apply_commits(commit 1,51217f33b)fluree-db-novelty/src/lib.rs— new bulk path designed for first-load / catch-up. One ingest pass routes flakes per-graph, parallel sort by identity-then-t, linear set-semantics dedup walk (matchesapply_commit'sfact_currently_asserted_in_graphskip rule for assertions; always keeps retractions), then four parallel sorts to build SPOT/PSOT/POST/OPST.O(N log N)total regardless of commit count.fluree-db-ledger/src/lib.rs::load_novelty— switches the deferred-batch replay loop from per-commitapply_committo a singlebulk_apply_commitscall. dict-novelty population still runs per-batch in commit order so overlay translation invariants are preserved.Range-aware
BranchedContentStore(commit 1,51217f33b)fluree-db-core/src/storage.rs— implementsContentStore::get_rangeonBranchedContentStore. Mirrorsget's ancestry-fallback semantics, callingget_rangenatively on each ancestor so range-capable backends keep their byte-range optimization across the entire chain.Envelope-only short-circuit (commit 2,
d5e03c27d)fluree-db-core/src/commit.rs— surfacesgraph_deltaon the publicCommitEnvelope(the binary envelope already encoded it; the v4 reader was dropping it on the floor). Adds new public helperfirst_t_where_graph_registered<C: ContentStore>(store, head, iri)that walks the DAG viaload_commit_envelope_by_id(byte-range ~128 KiB per envelope) and returns the lowesttwhereiriappears in any commit'sgraph_delta, orNoneif it never does. v3 chains returnNone(v3 envelopes never carriedgraph_delta) — callers fall through to a full load onNone.fluree-db-api/src/indexer_fulltext_provider.rs::resolve— runs the envelope-only probe beforeLedgerState::load. Ifconfig_graph_iri(ledger_id)is never registered in any commit'sgraph_delta, returns an empty configured-properties list immediately. NoLedgerState::load, no novelty build, no full commit reads. If the IRI is found, falls through to the existing load +resolve_ledger_configpath — which is itself fast now thanks tobulk_apply_commits.Regression tests (commit 3)
fluree-db-api/tests/it_reindex_pre_build_perf.rs(new):first_t_where_graph_registered_no_full_reads_when_iri_absent— deterministicCountingContentStoretest asserting the envelope walk uses onlyget_range, neverget, when the target IRI is missing.first_t_where_graph_registered_returns_lowest_t_when_iri_present— confirms the helper finds the earliest registrationt.orchestrator_first_reindex_no_config_completes_quickly— end-to-end orchestrator-path reindex of a 200-commit no-config ledger viaBackgroundIndexerWorkermatching the AWS Lambda wiring (with_fulltext_config_provider), with a 60s wall-clock budget far below the 13-minute Lambda waiter that motivated the fix.Effect on the original reindex scenario
Pre-fix (CloudWatch evidence, requestId
6e44e74e-1c8e-411b-a8b7-b73d8b268db8, cold start2026-04-30T16:21:35):LedgerState::load_noveltywalked all 787 commits viaread_commit_v4in 29sapply_commit× 787 inO(N²)replay then ran for 11+ minutes silentlyPost-fix (projected from in-process timings + Lambda ratios):
first_t_where_graph_registeredreturnsNone. It has nof:LedgerConfig— verified via DynamoDB query of nameservice, wherepk=dataset:main, sk=configshowsconfig_v: 0and noconfig_idfield.ApiFulltextConfigProvider::resolvereturnsVec::new()immediately. NoLedgerState::load, no novelty build.For ledgers with config in commits (test path
fulltext_configured_property_first_build_via_provider,fulltext_configured_property_picked_up_by_build_index_for_ledger, etc.), the envelope walk falls through to the full load path — which is now fast thanks tobulk_apply_commits. Behavior unchanged from a correctness standpoint.Diagnosis methodology
Iteratively bumped Lambda
RUST_LOGacross cold starts to localize the silent stretch:INFObaseline — only orchestrator + waiter messages visible, the 13-minute stretch invisible.info,fluree_db_indexer=debug,fluree_db_core::commit=debug,...— surfaced the 1574 = 2 × 787read_commit_v4events, bounded the catch-up at 29s. Span tagname:"load_commit"on every event traced the calls toload_commit_by_id.fluree-db-indexer/src/lib.rs:122-126→fluree-db-api/src/indexer_fulltext_provider.rs:43-82→fluree-db-ledger/src/lib.rs::load_novelty:284) located both regressions.config_id: None, validating the envelope-short-circuit fast path.Audit of the proposed fix by an independent agent caught one early incorrect direction (skipping the provider on
index_head_id.is_none()would have silently broken config-via-commits on first build, failingfulltext_configured_property_first_build_via_provider). The final shape preserves correctness for that path while still avoiding the slow walk for no-config ledgers.Test plan
cargo fmt --all -- --checkpassescargo clippy --workspace --all-features --all-targets -- -D warningspassescargo nextest run --workspace --all-features --no-fail-fast— 6014/6014 tests pass (11 skipped — feature-gated S3 testcontainers paths run separately)fulltext_configured_property_first_build_via_providerand friends still pass — confirms config-via-commits fulltext path on first reindex is preservedit_rebuild_fetch_counts.rsstill passes — confirms Phase A/B fetch contract from PR Allow clj api to work with closed api ledger #158 is preservedit_indexing_workflow.rspasses — confirms orchestrator + manual-trigger paths unchangedit_reindex_pre_build_perf.rs:first_t_where_graph_registered_no_full_reads_when_iri_absent,first_t_where_graph_registered_returns_lowest_t_when_iri_present,orchestrator_first_reindex_no_config_completes_quicklyNotes
Read-path only on the
BranchedContentStorechange. No on-disk format changes.CommitEnvelope::graph_deltais a new public field, but the binary encoding already carried it — only the v4 reader surfaced it on the public type.v3 chains never encoded
graph_deltaon the envelope and will always returnNonefromfirst_t_where_graph_registered. Callers that need v3 compatibility should fall back to a full load onNone, whichApiFulltextConfigProvideralready does.Out of scope, follow-up candidates:
first_t_where_graph_registeredviabuffered(K)for very long chains.LedgerState::loadcallers (merge.rs:543,rebase.rs:348,ledger_info.rs:539) for similar slow-path opportunities now that the bulk-load infrastructure exists.