Project

General

Profile

Bug #10311

Object is deleted automatically if conditional PUT returns 412

Added by Zhi Zhang over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

After back-porting conditional PUT feature, test shows object will be deleted automatically if conditional PUT returns 412.

steps to reproduce:

1. PUT an object:

< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Date: Fri, 12 Dec 2014 12:22:45 GMT
< ETag: "732e976ffef9035fe23c352d2476bea0"
< Content-Length: 0
< Accept-Ranges: bytes
< P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM
DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY
ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
< Cache-Control: private
< Vary: Accept-Encoding
< Content-Type: application/xml

2. GET it without "If-Match" or "If-None-Match" header:
...
< HTTP/1.1 200 OK
< Date: Fri, 12 Dec 2014 12:25:10 GMT
< Content-Length: 1537
< Accept-Ranges: bytes
< Last-Modified: Fri, 12 Dec 2014 12:22:46 GMT
< ETag: "732e976ffef9035fe23c352d2476bea0"
< P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM
DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY
ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
< Cache-Control: private
< Content-Type: binary/octet-stream

3. PUT this object again with new content and using "If-Match" header with wrong Etag:
...

Authorization: AWS A1VEJWKDMG837WNA5UIK:Uyl+dtMGNh2fGz/y9RbYUN9LgME=
If-Match: 1234567
Content-Length: 3259
Expect: 100-continue

< HTTP/1.1 100 Continue
< HTTP/1.1 412 Precondition Failed
< Date: Fri, 12 Dec 2014 12:27:19 GMT
< Content-Length: 84
< Accept-Ranges: bytes

4. GET it again. It should return old content, but it returns 404:
...
< HTTP/1.1 404 Not Found
< Date: Fri, 12 Dec 2014 12:29:51 GMT
< Content-Length: 75
< Accept-Ranges: bytes
< P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM
DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY
ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
< Cache-Control: private
< Vary: Accept-Encoding
< Content-Type: application/xml
<
<Error><Code>NoSuchKey</Code></Error>

Associated revisions

Revision bf8f0625 (diff)
Added by Yehuda Sadeh over 5 years ago

rgw: only keep track for cleanup of rados objects that were written

Fixes: #10311

We're keeping track of rados objects that we've written so that we could
clean them up if needed. Earlier we weren't too accurate about it and
were also setting the head object that is yet to be written. This now
only applies to the tail data, and a bit clearer.

Signed-off-by: Yehuda Sadeh <>

Revision 0b5d8033 (diff)
Added by Yehuda Sadeh over 5 years ago

rgw: only keep track for cleanup of rados objects that were written

Fixes: #10311

We're keeping track of rados objects that we've written so that we could
clean them up if needed. Earlier we weren't too accurate about it and
were also setting the head object that is yet to be written. This now
only applies to the tail data, and a bit clearer.

Signed-off-by: Yehuda Sadeh <>

History

#1 Updated by Xiangyu Lv over 5 years ago

  • Status changed from New to Fix Under Review

Sent out the PR for fix: https://github.com/ceph/ceph/pull/3176

Also committed some functional test cases in: https://github.com/ceph/s3-tests/pull/27

Please help to review them.

#2 Updated by Xiangyu Lv over 5 years ago

  • Assignee changed from Xiangyu Lv to Yehuda Sadeh

#3 Updated by Sage Weil over 5 years ago

  • Status changed from Fix Under Review to Resolved

#4 Updated by Sage Weil over 5 years ago

  • Status changed from Resolved to Pending Backport
  • Backport set to giant,firefly

#5 Updated by Yehuda Sadeh over 5 years ago

  • Backport deleted (giant,firefly)

No need for backport tag. There's no conditional PUT in firefly / giant.

#6 Updated by Yehuda Sadeh over 5 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF