Giter VIP home page Giter VIP logo

Comments (2)

aschmahmann avatar aschmahmann commented on June 17, 2024 1

Seems reasonable. The main tradeoff here is that we might over-read data from disk which may/may not be that important.

The reprovider strategies are here

kubo/core/node/provider.go

Lines 130 to 139 in e22f47a

switch reprovideStrategy {
case "all", "":
keyProvider = fx.Provide(provider.NewBlockstoreProvider)
case "roots":
keyProvider = fx.Provide(pinnedProviderStrategy(true))
case "pinned":
keyProvider = fx.Provide(pinnedProviderStrategy(false))
default:
return fx.Error(fmt.Errorf("unknown reprovider strategy %q", reprovideStrategy))
}

Probably the easiest way to do this is:

  • "roots" -> keep doing the same thing
  • "pinned" -> do a first pass using the "roots" function and then do this function (maybe keep something like a bloom filter or map so we don't readvertise the same data twice in exchange for some more memory)
    • If the plan is to use a map here it'd probably be better to rewrite the function to enumerate the roots and then put them into a queue so we don't have to hit the datastore twice
  • "all" -> do a first pass using the "roots" function, then do the blockstore enumeration
    • Could do roots -> pinned -> all but if most of the data is pinned it'll require enumerating the blockstore twice which could be quite expensive. This way the worst case is if the blockstore is lots of tiny objects in which case the datastore and blockstore are both enumerated (might still be annoying, but likely less bad)

from kubo.

aschmahmann avatar aschmahmann commented on June 17, 2024

From conversation with @lidel:

Something we could also do here is doing a local walk (i.e. don't do any remote fetching) of MFS and announcing the file/folder roots first (along with the other "roots").

Tracked in #10386

from kubo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.