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

go/store/datas/pull: pull_chunk_fetcher: Move chunk fetching to a streaming interface instead of batch. #7644

Merged
merged 1 commit into from Mar 26, 2024

Conversation

reltuk
Copy link
Contributor

@reltuk reltuk commented Mar 25, 2024

We want to better pipeline I/O when pulling from a remote, and moving a streaming interface where storage can see more of the addresses that are needed at once will allow us to achieve it.

For now, we implement the streaming interface just by calling the existing batch get interface.

…eaming interface instead of batch.

We want to better pipeline I/O when pulling from a remote, and moving a
streaming interface where storage can see more of the addresses that are needed
at once will allow us to achieve it.

For now, we implement the streaming interface just by calling the existing
batch get interface.
@coffeegoddd
Copy link
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
b05d3d9 ok 5937457
version total_tests
b05d3d9 5937457
correctness_percentage
100.0

Copy link
Contributor

@macneale4 macneale4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a couple questions, but free to ship

mu.Lock()
missing.Remove(chk.H)
mu.Unlock()
select {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This select block is a little odd to me. Why aren't you just sticking chk into f.resCh and calling it a day? These are unlimited channels, so they aren't going to block, right? Does this avoid getting a panic when the channel has been closed prematurely?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The channels are blocking and unbuffered...it's a synchronous exchange. So here we don't have a way to bail early but the reader might have already shut down, so we need to get through the batch of responses by ignoring them.

if err != nil {
return err
}
if len(cChk.FullCompressedChunk) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only way this would happen would be if a CompressedChunk{} was returned, which should always be accompanied by an error. Is this out of an abundance of caution, or is there another case where this will come up?

@reltuk reltuk merged commit 0093f33 into main Mar 26, 2024
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants