Skip to content

fix(query): keep historical reads on one index version - #2331

Merged
bplatz merged 1 commit into
fluree:mainfrom
judepayne:fix/2265-historical-index-root
Nov 12, 2026
Merged

bplatz merged 1 commit into
fluree:mainfrom
judepayne:fix/2265-historical-index-root

Conversation

@judepayne

Copy link
Copy Markdown
Contributor

Fixes #2265

Ensure historical reads use the same index version throughout loading, even if a newer index is published concurrently. Mixing versions could cause data strings to be replaced by commit metadata.

Adds deterministic JSON-LD and SPARQL regressions; both fail without the fix.

Validation: 2,711 tests passed (11 skipped); Clippy and formatting passed.

@CLAassistant

CLAassistant commented Nov 11, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@bplatz bplatz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, and welcome — a great first PR.

The diagnosis is exactly right: the historical loader built its snapshot from one index root and then attached a store from whatever root a second nameservice lookup returned, so an index published in between left the snapshot's string watermarks pointing into a different dictionary. Binding the store to view.snapshot.index_root_id() is the minimal fix.

I also reverted the one line locally and both new tests fail with a commit id in place of digest-item-2-0-…, the symptom from #2265, so the regressions pin the bug rather than just passing. The gate on the old root's read makes the race deterministic, which is much appreciated.

@bplatz
bplatz merged commit b9413e7 into fluree:main Nov 12, 2026
19 checks passed
bplatz added a commit that referenced this pull request Nov 12, 2026
Brings in #2157, #2226, #2297, #2314 and #2331.

Conflicts:

- eval/helpers.rs (#2226): the filter verdict cache key takes main's store
  instance id and next's u32 graph id, and main's test builds its stores
  with next's `BinaryIndexStore::empty()`.
- grp_transact.rs lists both sides' test modules.
- #2157 changed `retract` and `drop_branch` on every nameservice backend,
  and the nested-ledger prefixes a sweep excludes. next replaced those
  operations with the fenced record store, so the nameservice, sweep and
  drop-test hunks take next's side here. The next commit carries the fix
  to next's operations.
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.

Time-travel read (from: <ledger>@t:N) intermittently returns commit metadata (commit id, ledger alias) as data values, right after an index publish

3 participants