digidem / mapeo-core

Library for creating custom geo data and syncronizing via a peer to peer network
23 stars 2 forks source link

Support sparse hypercore (sync + indexing) #54

Open hackergrrl opened 4 years ago

hackergrrl commented 4 years ago

Right now the mapeo stack doesn't handle sparse data well, which can occur in the case of a sync that is prematurely terminated. What happens is

  1. sync no longer finishes (this is worked around right now using a ~20s timeout + no data seen on the sync stream).
  2. multifeed-index stops indexing a feed if it hits a set of N sequence numbers that have missing blocks. It will resume if/when that data is available, but it works sequentially right now, so if, say block 0 were missing, no indexing on that feed would happen, even if later sequence numbers were available.

I'm thinking of some fixes for this:

okdistribute commented 4 years ago

I think some of this is what @telamon is attempting to address with https://github.com/decentstack/.

okdistribute commented 4 years ago

see: https://github.com/decentstack/decentstack/blob/master/docs/middleware_interface.md

telamon commented 4 years ago

Wow @okdistribute , yes! Im a bit surprised you dug up the prerelease docs! But yes i hope to provide an extra layer of control to applications :)

okdistribute commented 4 years ago

Pulling this over from #96, by @noffle

As a future reference for what a more complete fix might look like: