-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add merge
method for combining changes from multiple stores
#154
Closed
Closed
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
62c47d8
Start figuring out merging multiple stores
mpiannucci c1af856
Add experimental merge method to zarr store
mpiannucci 3ed1187
Change all distributed commits to merge and commit in rust repo
mpiannucci a3cf364
lint rust crate
mpiannucci bc7b2e5
Cleanup commented out code
mpiannucci 67388ca
Minimize write locks needed from zarr store and python interface
mpiannucci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is required to check for errors and exit early if there are some. IDK if this is the right approach...
If one fails should the others still merge? What about ones that come before?
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 think this is the right approach. We never want jobs to successfully commit if one of their workers failed or is still working. This may even be somewhat common, bad concurrent code tries to merge while there is other thread still doing work, and in that case,
Arc::try_unwrap
will fail.If they want to commit anyway, they can do it explicitly, by not passing those stores. What is very important is recoverability: We let them know something is still going, they wait and try again. So, I think there are better return types for this function, something like:
returns the list of Store that are still pending. The user can wait on those somehow and try to merge them again. The ones that succeeded are gone (not really gone, just merged).
Things we should think more about:
Vec
in the return type though, we may want to think some more. I'm a bit worried about the ugly case in which people use dask and every chunk becomes a task, and we have millions of things to merge.nit:
try_collect
is usually more readable.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.
A few more thoughts, always about this real wold scenario where a thread is trying to do
set
while other is trying tomerge
all repos.&mut
instead? It may be more faithful to realityor whatever way you write t hat, there is probably some amount of
as IntoItorator
missing.ready_to_merge
function that verifies the ref count on the arc == 1We should talk more about all this, fun stuff.
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 just had another idea. All the issues arise because we are trying to merge multiple stores. This also makes it harder on the python side, because we need to be very careful using a generator and not a list. I think there is a much easier way, only allow merging one store into
self
. Let the user deal with gathering all of them and callingmerge
one by one. I think this is also easier on the user, they just need to get results as soon as they are produced, and call merge on them.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.
This is also the approach I started doing in Python, so we got to the same place! I wound up reverting it because the lifetimes were driving me nuts, but I totally agree that is the approach we should use