Integrate sync with s3transfer #2149
Merged
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.
So there is actually not much happening in this PR other than flipping sync to use the new architecture. Most of the code being added is actually from this PR: #2147.
So I was actually surprised that had to make this little of a change to get this to work because I do not at all take into account source clients when I do sync across buckets of different regions with a
--delete. This is because we have auto-redirection now by default in botocore for sigv4. The question now becomes is the auto-redirection good enough to handle that use case? Also is there any other edge cases that I miss by not providing a source client for deletes. The only other edge case I could think of is kms, but for deletes of kms sigv4 is not needed.The only reason I did not add support for providing support for a source client is that client's are attached to their TransferManager. There is currently no way to swap the two out. I thought about what I would do and these were the two best options I can think of:
future.meta.provide_client()to allow you to provide a different client for a particular transferOption 1 or something along the lines of option 1 is the most realistic option. Option 2 is not really realistic at all.
Let me know what you think. Given that we cache the region at the client level and the integration test pass, I am fine with relying on redirection as opposed to having to add a new abstraction.
cc @jamesls @JordonPhillips