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

bitswap: redo: don't re-provide blocks we've provided very recently #3253

Closed
wants to merge 1 commit into from

Conversation

kevina
Copy link
Contributor

@kevina kevina commented Sep 23, 2016

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.

@Kubuxu Kubuxu added the status/in-progress In progress label Sep 23, 2016
@kevina kevina mentioned this pull request Sep 23, 2016
6 tasks
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>
@kevina kevina force-pushed the kevina/bitswap/dup-prov-cache-redo branch from 43d7d8e to 12c9078 Compare September 23, 2016 18:23
@kevina kevina changed the title WIP: Redo bitswap: don't re-provide blocks we've provided very recently bitswap: redo, don't re-provide blocks we've provided very recently Sep 23, 2016
@kevina kevina changed the title bitswap: redo, don't re-provide blocks we've provided very recently bitswap: redo: don't re-provide blocks we've provided very recently Sep 23, 2016
@kevina
Copy link
Contributor Author

kevina commented Sep 23, 2016

@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.

@kevina kevina added the need/review Needs a review label Sep 23, 2016
@whyrusleeping
Copy link
Member

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?

@kevina
Copy link
Contributor Author

kevina commented Oct 6, 2016

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.

@whyrusleeping
Copy link
Member

Having a separate blockservice is okay. If you did that would you still need the whole multiblockstore thing?

@kevina
Copy link
Contributor Author

kevina commented Oct 6, 2016

Yes, What makes you think otherwise?

On Wed, 5 Oct 2016, Jeromy Johnson wrote:

Having a separate blockservice is okay. If you did that would you still need the whole multiblockstore thing?

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#3253 (comment)

@whyrusleeping
Copy link
Member

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.

@kevina
Copy link
Contributor Author

kevina commented Oct 6, 2016

Changing the return signature like that shouldnt be necessary.

Note, that another reason I opted to changing the return type was to avoid calling Has() twice.

@kevina
Copy link
Contributor Author

kevina commented Oct 6, 2016

@whyrusleeping, please let me know if you are okay with, aab19fd. If you don't like the checkFirst flag in blockservice, I can have NewWriteThrough create a new class that reimplements AddObject/AddObjects at the expense of some code duplication and indirection.

I will make a new pull request once #3255 get merged. (I am sick of dealing with conflicts.)

@kevina
Copy link
Contributor Author

kevina commented Oct 8, 2016

closing in favor of #3294

@kevina kevina closed this Oct 8, 2016
@kevina kevina removed the status/in-progress In progress label Oct 8, 2016
@Kubuxu Kubuxu deleted the kevina/bitswap/dup-prov-cache-redo branch February 27, 2017 20:40
@aschmahmann aschmahmann mentioned this pull request Aug 23, 2021
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants