-
-
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
Create a write-through block service #3294
Conversation
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.
Think you could add a test or two to make sure the 'writeThrough' happens as expected?
Exchange exchange.Interface | ||
blockstore blockstore.Blockstore | ||
exchange exchange.Interface | ||
// If checkFirst is true than first check that a block doesn't |
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.
typo: s/than/then/
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.
Fixed.
0fc7ae4
to
ba0b0f1
Compare
Off hand, I am not sure how. It is not used outside of #2634. Several test in #2634 will fail if the writes don't make it through to the blockstore. In particular, In the backing file moves, the way to update the block is to re-add the file under the new name. One thing I meant to ask you is if you want to use this by default for the normal add path? This will restore the behavior of readding a file will re-publish it. If this is done there might be a way to test for that, but I might need some help as I am not sure how to test if a block is (re)published. |
@Kubuxu Okay, this is going to need to be rebased. I'll handle that once I get the all clear. @whyrusleeping does this Look-Good-To-You now? |
License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
a75bdff
to
dfd5e9a
Compare
Create a block service where all writes are guaranteed to go though to the blockstore. License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
@whyrusleeping rebased and all test are green. Does this look good to you. |
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.
Just one small minor tiny nitpicky change, then i'll merge it. I promise
|
||
toput = append(toput, b) | ||
} else { | ||
toput = bs; |
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.
semi colons??? noooo
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 ran a gofmt and pushed it
License: MIT Signed-off-by: Jeromy <[email protected]>
Create a block service where all writes are guaranteed to go though to the blockstore.
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 first attempt to fix this was #3253, this is the second.
This also makes BlockService an interface, although in the end it was not strictly required.