If-None-Match doesn't work on deleted object

Bug #1640448 reported by Thomas Herve
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
High
Unassigned

Bug Description

Considering the following scenario

put_object('mycontainer', 'myobj1', 'content', headers={'if-none-match': '*'})
delete_object('mycontainer', 'myobj1')
put_object('mycontainer', 'myobj1', 'content', headers={'if-none-match': '*'})

As of swift master, the last put_object fails with a 412, even if the object has been deleted. It looks like it may be a regression of https://review.openstack.org/281636/

Revision history for this message
Christian Schwede (cschwede) wrote :

I can confirm this, and indeed it looks like commit ddeb0cde9fc828fa79dce90df4975f66737ba054 introduced this.

Doesn't work after that commit, but works fine before this. Problem is https://github.com/openstack/swift/blob/master/swift/obj/server.py#L688-L696

Changed in swift:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Christian Schwede (cschwede) wrote :

Updated functional test that fails on master, but succeeds on ddeb0cde9fc828fa79dce90df4975f66737ba054~1.

Changed in swift:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/395582
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=2bdf61fadda655323a36185f921f8a3e183bcdf9
Submitter: Jenkins
Branch: master

commit 2bdf61fadda655323a36185f921f8a3e183bcdf9
Author: Thomas Herve <email address hidden>
Date: Wed Nov 9 14:02:23 2016 +0100

    Handle deleted files with if-none-match

    When an object is deleted, we retrieve its metadata on the next PUT
    requests, which make if-none-match requests fail while the object
    shouldn't be here. It seems we're only interested in the timestamp of
    the deleted object, so get that but forget the metadata.

    Change-Id: I4a4a8be9b631598ca1cd52c53885c68c3fbdfc4a
    Closes-Bug: #1640448

Changed in swift:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.12.0

This issue was fixed in the openstack/swift 2.12.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.