s3api claims to delete an object when it hasn't actually done it
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
New
|
Undecided
|
Unassigned |
Bug Description
Funny story time:
An S3 client creates a whole bunch (~12k) of objects. This puts load on disks, to the point that some start getting error limited. A handful of objects get pretty unlucky: not only are 2/3 primaries error-limited, but so are the first three handoffs! That's OK, Swift can manage -- since they were error limited, we just skip over them and try to PUT the data on that last primary and the fourth and fifth handoffs. PUT to the primary fails (something about BadStatusLine -- coulda been a timeout or a restart or something) but the two deep handoffs succeed so we can reply 201.
A little while later (long enough that error-limiting's worn off, but not so long that replication's had a chance to do its job), the client comes through and deletes everything. The way s3api does that is to first do a HEAD to determine whether it's a multipart upload or not, then do a DELETE either with or without a ?multipart-
"Well *there's* your bug," you say. "We should have still issued the DELETE!" However:
- We just did a whole bunch of work to look for the object -- do we
really want to go to disk *again* to write down something everyone
already seems to know?
- That HEAD was important -- if the object was a multi-part upload,
all of the segments are in a +segments container where *the client
can't see them*. If we issue the DELETE, the object would get
cleared out of listings and requests for it would eventually 404,
but the user's account would still be using up space (and getting
billed for it) while we actively prevent their client from telling
them why.
One more argument in favor of issuing the delete: container listings may never have gotten the message about object deletes. This may lead to containers you can't easily delete via the S3 API (if, say, your s3 client is opinionated and only wants to issue multi-deletes). May be the root cause for https:/ /ask.openstack. org/en/ question/ 114715/ s3-method- post-on- bucket- with-query- delete- doesnt- work/