Skip to content

Conversation

@sivel
Copy link
Contributor

@sivel sivel commented Oct 9, 2014

This pull request brings back functionality that was removed in 1.9.

  1. normalize keys to match the documentation (Ref: bulk_delete() returns a dictionary with wrong keys #479)
  2. Support deleting more than 10000 objects (Ref: container.delete_all_objects() doesn't function properly #392)
  3. When we ask to delete all objects, actually list them all (Ref: container.delete_all_objects() doesn't function properly #392)

@sivel sivel added the bug label Oct 9, 2014
@sivel sivel self-assigned this Oct 9, 2014
@bazzilic
Copy link

bazzilic commented Oct 9, 2014

Having looked through your PR, I have a suggestion: in case Response Status is not 200 OK map Response Body to errors.

@sivel
Copy link
Contributor Author

sivel commented Oct 9, 2014

errors should already be populated in such a case. If I add additional information into errors the length of the list will not match the actual number of errors:

http://docs.rackspace.com/files/api/v1/cf-devguide/content/Bulk_Delete-d1e2338.html.html#d6e8440

I'm still working on fixing some related issues, so there will be more commits added soon. Specifically, I am also working on some issue that are part of #392

@bazzilic
Copy link

bazzilic commented Oct 9, 2014

I had a situation today, which led to me opening this issue. I was trying to delete 12k objects, CloudFiles returned a status 413 Request Entity Too Large. Request Body contained an explanation that we can only delete no more than 10k objects in one request. However, the Errors list was empty.

@sivel
Copy link
Contributor Author

sivel commented Oct 9, 2014

Ok, I'll try to look into that. Part of this PR is also to fix the 413 Request Entity Too Large issue.

@bazzilic
Copy link

bazzilic commented Oct 9, 2014

Yes, I noticed that. I am doing it a bit differently, but your approach looks more memory efficient.

page_size = 5000
for batch in [names[i:i+page_size] for i in range(0, len(names), page_size)]:
    ctx.get_client("object_store", region, public=False).bulk_delete(container, batch)

sivel added a commit that referenced this pull request Oct 21, 2014
BulkDeleter: normalize return keys and support > 10000 objects
@sivel sivel merged commit 23e49f4 into pycontribs:working Oct 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants