object delete doesn't work with object count greater than page size
Bug #1679851 reported by
John Dickinson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-swiftclient |
Fix Released
|
Low
|
Unassigned |
Bug Description
When trying to delete a large number of objects, the client will detect this and use the bulk delete feature if it's enabled in the cluster. However, the bulk delete feature has a page size. If the number of objects to be deleted is larger than the page size, the operation will fail silenty. no error is returned.
This was seen "in the wild" when trying to delete approximately 150000 objects with a bulk delete page size set to the default of 10000.
tags: | added: low-hanging-fruit |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/454849 /git.openstack. org/cgit/ openstack/ python- swiftclient/ commit/ ?id=0cc4d8af181 57000d4d5d12057 00d6494c5935ce
Committed: https:/
Submitter: Jenkins
Branch: master
commit 0cc4d8af1815700 0d4d5d1205700d6 494c5935ce
Author: John Dickinson <email address hidden>
Date: Tue Apr 4 15:20:30 2017 -0700
respect bulk delete page size and fix logic error
Previously, using SwiftService to delete "many" objects would use
bulk delete if available, but it would not respect the bulk delete
page size. If the number of objects to delete exceeded the bulk delete
page size, SwiftService would ignore the error and nothing would be
deleted.
This patch changes _should_ bulk_delete( ) to be _bulk_delete_ page_size( );
instead of returning a simple True/False, it returns the page size for
the bulk deleter, or 1 if objects should be deleted one at a time.
Delete SDK calls are then spread across multiple bulk DELETEs if the
requested number of objects to delete exceeds the returned page size.
Fixed the logic in _should_ bulk_delete( ) so that if the object list
is exactly 2x the thread count, it will not bulk delete. This is the
natural conclusion following the logic that existed previously: if
the delete request can be satisfied by every worker thread doing one
or two tasks, don't bulk delete. But if it requires a worker thread
to do three or more tasks, do a bulk delete instead. Previously, the
logic would mean that if every worker thread did exactly two tasks, it
would bulk delete. This patch changes a "<" to a "<=".
Closes-Bug: 1679851 dc62187114ef06d be721afcc2e
Change-Id: I3c18f89bac1170