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

service/share: Implement parallelisation for GetSharesByNamespace #184

Closed
renaynay opened this issue Nov 9, 2021 · 6 comments · Fixed by #241
Closed

service/share: Implement parallelisation for GetSharesByNamespace #184

renaynay opened this issue Nov 9, 2021 · 6 comments · Fixed by #241
Labels
area:shares Shares and samples enhancement New feature or request

Comments

@renaynay
Copy link
Member

renaynay commented Nov 9, 2021

Implement parallelisation for GetSharesByNamespace when there are multiple rows that contain the given namespace.ID.

@renaynay renaynay added enhancement New feature or request area:shares Shares and samples labels Nov 9, 2021
@vgonkivs
Copy link
Member

Hi @renaynay , may I take this one?

@renaynay
Copy link
Member Author

Hey @vgonkivs we are currently debugging an issue with ipld + bitswap, so will wait on @Wondertan for further notice. But after that bug is fixed, that would be great!

@vgonkivs
Copy link
Member

Ok, then I will wait until the bug will be fixed.

@renaynay
Copy link
Member Author

It's been fixed! @vgonkivs

@vgonkivs
Copy link
Member

Great. So If I understand correctly, rowRootCIDs and namespacedShares in GetSharesByNamespace should fill concurrently, right? Since appending is not a thread safe operation, should I protect it by adding a local mutex or mutex should be added to service ?

@renaynay
Copy link
Member Author

renaynay commented Dec 2, 2021

I would say the best approach is:

step 1: figure out which rows (rowRootCIDs) contain the given nID
step 2: loop over the rowRootCIDs and spawn a go routine on each row to return the namespacedShares from that row
step 3: if even 1 error occurs, return nil, err.

step 2 is the only one that should be happening concurrently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:shares Shares and samples enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants