Sync with other peers never re-downloads blobs
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- distributed-systems
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.
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.
- Dominant language
- Rust
- Stars
- 81
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from n0-computer/iroh-docs
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
n0-computer/iroh-docs#124 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
n0-computer/iroh-docs#122 ·
-
Sync with a peer stays wedged after one AlreadySyncing refusal (local state never leaves Running)Open
Difficulty 3/5 Half a day Newbie friendliness 62/100
n0-computer/iroh-docs#121 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
n0-computer/iroh-docs#120 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
n0-computer/iroh-docs#109 ·
All issues in n0-computer/iroh-docs
Similar issues
-
area:web kind:bug priority:p2 ready
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
sims1253/r-typeshed#140 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
storytold/craft-libs#2867 ·
Maintainers usually reply within 1 day
-
help wanted needs investigation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 62/100