Open hackergrrl opened 4 years ago
I think some of this is what @telamon is attempting to address with https://github.com/decentstack/.
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 :)
Pulling this over from #96, by @noffle
As a future reference for what a more complete fix might look like:
opts.sparse = true
all the way down the stack to hypercore (kappa-osm -> kappa-core -> multifeed -> hypercore)core.download()
requests for only those blocks
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
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 block0
were missing, no indexing on that feed would happen, even if later sequence numbers were available.I'm thinking of some fixes for this:
opportunistic
sync mode in mapeo-core (or maybemultifeed
?), which usespeer.remoteBitfield
on the remote hypercore(s) to figure out what entries each remote feed has, and request only those. Done in sparse mode, this will let sync properly terminate.multifeed-index
to maintain a bitfield (not unlike hypercore does) of what's been indexed, so that subsequent runs of the indexer will know where it left off. This will let the indexer actually index what's available and handle holes in the data ok.