Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lean on datastore queries in provider queue #6260

Closed
Stebalien opened this issue Apr 26, 2019 · 2 comments
Closed

Lean on datastore queries in provider queue #6260

Stebalien opened this issue Apr 26, 2019 · 2 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now topic/provider Topic provider

Comments

@Stebalien
Copy link
Member

At the moment, we read in the head/tail of the provider queue on start. However, it's probably easier to just repeatedly query the datastore.

That is,

  1. Store provider queue entries as /provider/queue/$nanosecond-timestamp/$cid -> (or even just /provider/queue/$start-timestamp.$counter).
  2. Each time we're signaled (size-one channel?) that something was enqueued, query Query{Prefix: "/provider/queue/", Order: [OrderByKey]}.

Motivation: track less state. This is really low-priority, it just may simplify this queue a bit and remove room for bugs.

@Stebalien Stebalien added kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now labels Apr 26, 2019
@momack2 momack2 added this to Inbox in ipfs/go-ipfs May 9, 2019
@michaelavila michaelavila added topic/provider Topic provider kind/enhancement A net-new feature or improvement to an existing feature and removed kind/enhancement A net-new feature or improvement to an existing feature labels Jun 5, 2019
@michaelavila
Copy link
Contributor

Noted 👍. I'll look into this as I'm working on the remainder of the provider PRs. Thanks for bringing it up.

@michaelavila
Copy link
Contributor

Closing as this has been implemented. Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now topic/provider Topic provider
Projects
No open projects
Development

No branches or pull requests

2 participants