-
Notifications
You must be signed in to change notification settings - Fork 248
Making batch object deletion more robust #478
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
Conversation
Thanks @jamiehannaford. I'll review this within a couple of hours. |
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.
Nit: make the 10000
a class constant.
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.
will do
@ycombinator Ready for review again |
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.
Thinking about this some more, I wonder if the chunking should be handled inside the bulkDelete
method. This way every caller of it wouldn't have to worry about it.
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 thought about that too, but the problem with moving the chunking to bulkDelete is that we'll also need to change the method's response type from a singular Response to an array of Responses - which is a non-BC change
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.
Oh, good point. What do you think about providing a convenience method alongside bulkDelete
, then? This method would implement the chunking and return an array of Response
s.
I've been testing this change with the test script. So far I've run the script three times and it has failed all times with the same 409 Conflict error as before. When I check the container, it still contains one or two objects in it. So either the bulk delete API is also intended to be asynchronous with the actual deletes or this is a bug upstream. @jamiehannaford: Could you try the test script a couple of times as well, please? |
…; add container waiter
@ycombinator This is ready for another round of review. I tested before I made the above changes on two very large containers (one had +1000 objects, the other +600) and both deleted all the objects successfully. The only bug was that the |
|
@ycombinator PSR stuff should be fixed. The other issue is weird. I just tested again with a container in IAD (800+ objects, most of which were over 40KB in size), and it deleted everything successfully (all the objects and the container) without a 409... |
@jamiehannaford Interesting. Let me try IAD instead of DFW. Would you mind trying the inverse on your end (DFW instead of IAD)? |
I just tried IAD instead of DFW three times and was unable to reproduce my issue even once! So it appears that this issue might be region-specific. I'm testing in ORD now but I think, regardless of my findings, this PR has some improvements and is good to be merged. Will merge shortly. |
Making batch object deletion more robust
When containers are deleted and
true
is passed in as an argument, the SDK will delete all the existing objects inside this container before issuing a final DELETE request for the container itself. The current method of doing this is not optimal because:To address these issues, I've implemented two fixes:
X-Container-Object-Count
metadata value equals0
(by continuously polling via HEAD requests).This should go some way to fixing #477.