Skip to content

fs store: preserve recoverable states and terminate broken observes - #243

Closed
YuniqueUnic wants to merge 1 commit into
n0-computer:mainfrom
YuniqueUnic:fix/fs-store-poisoned-state
Closed

fs store: preserve recoverable states and terminate broken observes#243
YuniqueUnic wants to merge 1 commit into
n0-computer:mainfrom
YuniqueUnic:fix/fs-store-poisoned-state

Conversation

@YuniqueUnic

Copy link
Copy Markdown

Closes #233.

Summary

  • prevent HashContext::persist() from destructively replacing non-Partial storage with Poisoned
  • distinguish missing external references from store-owned corruption and metadata/I/O failures
  • try all external data candidates during load and export
  • wait through Initial/Loading, emit empty only for NonExisting, and terminate observe for Poisoned

This keeps an empty bitfield meaning “valid entry with no verified data” and uses the existing stream failure path for broken entries, following the design discussion in #214.

Recovery semantics

  • all external paths missing: NonExisting, allowing a normal re-fetch/import
  • owned data/outboard missing, invalid external metadata, permission/DB/I/O failure: terminal Poisoned
  • first external path missing but a later candidate is readable: use the later candidate

Tests

  • safe partial extraction without mutating complete/missing states
  • transitional observe waiting and poisoned observe termination
  • missing vs invalid external metadata
  • external candidate fallback across restart for observe and export
  • all external files removed followed by successful re-import
  • missing store-owned data returns an observe error without panicking

Verified with:

  • cargo test --all-features (103 unit passed, 2 ignored; 6 integration passed; 17 doctests passed)
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

@n0bot n0bot Bot added this to iroh Jul 18, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Jul 18, 2026
@YuniqueUnic
YuniqueUnic deleted the fix/fs-store-poisoned-state branch July 20, 2026 13:36
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

fs store: two root causes of "poisoned storage should not be used" panic (persist + load NotFound)

1 participant