Skip to content

materialize gate-fail drop is name-scoped (DropMode::Hard hits every branch); no branch-scoped hard purge #1592

Open

Description

@aaj3f

From PR #1582 review (bplatz, id=3717339919).

Context

When a fluree materialize parity gate fails, the CLI drops the twin so an
unverified twin is never left announced (fluree-db-cli/src/commands/materialize.rs,
the report.passed == false arm). That drop is name-scoped:

fluree.drop_ledger(ledger_name_no_branch(&twin_ledger), DropMode::Hard)

drop_ledger rejects a :branch suffix and hard-purges every branch of the
ledger name (admin.rs collects all_records().filter(|r| r.name == ledger_name)).

Current mitigation

The CLI closes the hazard up front: blocking_existing_branch refuses the
build unless the ledger name is fresh apart from the target branch (CRITICAL-1,
#1529 review), so the name-scoped drop "can only ever hit a ledger this build just
created." This makes the CLI path safe today.

Gap

The destructive name-scoped DropMode::Hard itself is unchanged and unguarded for
any driver that replicates the publish → verify → drop-on-fail pattern via the API
without the CLI's up-front refusal. Belt-and-braces would scope the gate-fail drop
to the branch the build created.

There is currently no branch-scoped hard purge:

  • drop_ledger is name-only (rejects a branch suffix).
  • NameService::drop_branch removes only the nameservice record for a branch
    (and refuses a branch with children) — a weaker guarantee than DropMode::Hard,
    and it could leave the twin's storage data orphaned.

Ask

Add a branch-scoped hard-drop capability and use it on the materialize gate-fail
path, so the drop retracts exactly the build-created name:branch (data + record)
and never any sibling branch — independent of the CLI's up-front guard.

Referenced from the code at fluree-db-cli/src/commands/materialize.rs (gate-fail
drop comment).

Activity

  1. added
    P2
    area:storage
    on Aug 25, 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

    P2area:storage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions