Skip to content

Order index roots replaced at the same t by a sequence on the index head #2178

Open

Description

@bplatz

#2140 (pooled named graphs, on next) lets an index root be replaced at the same t: a compaction folds the pooled delta into its base, and a reindex can rebuild at the head t. index_t then no longer orders a ledger's roots. #2140 orders them with the installed root's prev_index link, one hop deep: a reader refuses to step back to the root its own root replaced (is_replaced_by in fluree-db-ledger/src/lib.rs).

Two replacements at one t get past that rule. Take compaction A → B, then a reindex or a second compaction B → C. A reader on C that acts on a record read before B (still naming A) finds A is neither C nor the root C replaced (B), so it steps back two hops to A. A holds the same t, so the reader serves the uncompacted layout until its next refresh. If A's runs and leaves were collected in the meantime, the load fails.

A monotonic sequence on the index head, bumped by every publish including a same-t replacement, would order replacement roots outright. This is the same shape as #1980 and #2052: a point in time standing in for an identity that can now change without the time moving.

Found by reading during review of #2140; not constructed.

Activity

  1. added
    P3
    area:storage
    on Oct 24, 2026
  2. added this to the 5.0.0 milestone on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:storage

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions