-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
bitswap: redo: don't re-provide blocks we've provided very recently #3253
Conversation
Redo how pull request #3105 is implemented. Instead of calling Has() is the blockservice modify the blockstore interface to return the blocks actually added. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
43d7d8e
to
12c9078
Compare
@whyrusleeping if you don't like the idea of this pull request I am going to need to find another way around the problem. I will likely have to use my own BlockService when adding files via the filestore. I also removed a comment you added later because I don't think it is relevant anymore, but I admit I do not 100% understand the comment is saying either. |
Alright, finally getting to this one. We're gonna have to find a different way to do this. Changing the return signature like that shouldnt be necessary. You say you could use your own blockservice instead? what would that roughly look like? |
I will basically need to duplicate BlockService and to provide a version of AddObject and AddObjects that don't do the Has check. They might also just not publish, but I'm not sure if that is the best idea. |
Having a separate blockservice is okay. If you did that would you still need the whole multiblockstore thing? |
Yes, What makes you think otherwise? On Wed, 5 Oct 2016, Jeromy Johnson wrote:
|
I was thinking that all the logic youre doing with multiple blockstores could be abstracted into the blockservice. Your modified blockservice could have a blockstore, a filestore, and an exchange. |
Note, that another reason I opted to changing the return type was to avoid calling Has() twice. |
@whyrusleeping, please let me know if you are okay with, aab19fd. If you don't like the checkFirst flag in blockservice, I can have I will make a new pull request once #3255 get merged. (I am sick of dealing with conflicts.) |
closing in favor of #3294 |
Pull request #3105 (bitswap: don't re-provide blocks we've provided very recently) broke adding files via the filestore (i.e., --no-copy, #2634). The filestore code requires that all writes go through to the blockstore. In addition the blockstore already checks if a block already exists. This change avoids calling
Has()
is the blockservice and instead modifies the blockstore interface to return the blocks actually added.#3105 also changed AddBlocks (now AddObjects) to just return the blocks added. This pull request restores the original behavior. At this point I am not even sure if this return value is used anywhere.