Skip to content

Require new epoch roots to pin before replacing the previous root #612

Description

@lthibault

Epoch advance currently logs a failed pin_add, continues to swap the CidTree root, and unpins the previous root. A failed recursive pin can therefore leave both the newly selected root and the previous active root unpinned and collectible.

Make the pin/swap/unpin transition safe: do not unpin the prior root or publish the new epoch unless the new root is durably pinned (or define and expose an explicit alternative recovery state).

Acceptance criteria:

  • pin failure preserves the previous root and pin;
  • success maintains the documented ordering;
  • focused tests cover pin failure, pre-warm failure, and successful advancement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions