n0-computer / n0-computer/iroh-docs

Sync with other peers never re-downloads blobs

Open
#82 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
74
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Current system allows to set a Download policy so you automatically download values (blobs) from peers that inserted an entry.

When everyone is connected, and you are fully synced, it works without any problem and it automatically downloads from peers. It also maintains a list of missing_hashes in case who inserted doesn't have the hash yet, and later downloads from them when it receives a ContentReady event.

The problem arrises when you first sync with a peer that doesn't have all blobs downloaded. This might happen because it didn't download yet or because their Download Policy doesn't allow them to download it.

After that, the system will never try to download from any other peer that information unless you do so locally. Even if you sync with other peers, you only exchange information about the keys, so in case your keys are synced, you don't try to download the values.

For me, this seems like a non intended behavior because the download policy of one peer shouldn't affect other peers that are actively downloading all values.

Other projects like iroh-lan, do the re-syncing themselves by querying the whole key-value store and looking for missing hashes in blobs then retrying download them from other peers.

This could be done more efficiently inside Docs and also emitting events about ContentReady again so when someone does the syncing, others could piggyback and request any missing_hashes on their side directly, reusing docs machinery.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Docs synchronization path, Download policy handling, missing_hashes tracking, and ContentReady events described in the issue. Compare the behavior with the linked iroh-lan router.rs approach; done means a peer can re-sync with another peer and obtain blobs that an earlier peer did not have, without local intervention.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.