Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support Asynchronous Writing Datastores #140
Support Asynchronous Writing Datastores #140
Changes from all commits
00a16ea
2b236db
8ddf6ad
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. This looks like a bug in
lookupAll
.lookupAll
should only return mounts that can contain descendents ofkey
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge this as-is and fix it later or move this logic into
lookupAll
now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify what you think the bug is here? It looks like the documented behavior for
lookupAll
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookupAll
is supposed to return all datastores that might contain keys that are descendants of the given key. That means we should be callingSync
on all datastores returned bylookupAll
datastores and we shouldn't have this extra check.However, if we have
["/foo", "/foo/bar"]
,"/foo"
should "cover""/foo/bar"
given thatlookup
will always return"/foo"
. However, when given the prefix"/foo"
,lookupAll
will return both.Note: this is only technically a bug. Nobody would ever mount
"/foo"
over"/foo/bar"
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was expected behavior that we might mount "/" and also "/foo", or is the root a special case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first example was bad: order matters. If we mount "/" over "/foo", "/" will win (I think? check me here). In go-ipfs, we mount "/blocks" over "/".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I say "nobody would ever mount "/foo" over "/foo/bar" because "/foo" is a prefix of "/foo/bar" (and we check mounts in-order).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong. We reverse-sort datastores so "/foo/bar" always comes before "/foo".
However, the bug was valid. Fix in #141.