Project

General

Profile

Rgw - If-Match on user-defined metadata

Summary

This is a proposal to add "If-Match" checking on user-defined metadata in RADOSGW.

Owners

  • Ray Lv (Yahoo)
  • Name (Affiliation)
  • Name

Interested Parties

  • Name (Affiliation)
  • Name (Affiliation)
  • Name

Current Status

The current RADOSGW supports the HTTP "If-Match"/"If-None-Match" semantics on ETag.

Detailed Description

In some application scenarios, we need conditional read/delete/update/copy by checking if user-defined metadata matches. Since RADOSGW supports HTTP "If-Match"/"If-None-Match", it can be implemented by adding additional headers and similar logic.
  • Conditional Read: Similar to the HTTP conditional GET
  • Conditional Delete: It brings delete-if-user-defined-metadata-matches semantics to S3 API. It should be supported both in DELETE operation and Multi-Object Delete operation.
  • Conditional Update: It brings test-and-set on PUT/POST semantics to S3 API.
  • Conditional Copy: Similar to the S3 Copy Object API.

Interfaces

"x-amz-if-match” header can be used here to indicate additional checking on value of metadata in list. RADOSGW will response 412 Precondition Failed if the checking failed. The following is a sample request.

1) Conditional Read
GET Object

GET /Bucket001/6619810111 HTTP/1.1
x-amz-if-match: x-amz-meta-userdefined="0"

2) Conditional Delete
DELETE Object

DELETE /Bucket001/6619810111 HTTP/1.1
x-amz-if-match: x-amz-meta-userdefined="0"

Multi-Object Delete

POST /Bucket001?delete HTTP/1.1
<Delete>
 <Object>
   <Key>6619810111</Key>
   <If-Match>
     <Key>x-amz-meta-userdefined</key>
     <Value>0</Value>
   </If-Match>
 </Object>
<Delete>

POST /Bucket001?delete HTTP/1.1
<Delete>
 <Object>
   <Key>6619810111</Key>
   <If-Match key="x-amz-meta-userdefined" value="0"/>
 </Object>
<Delete>

3) Conditional Update
PUT - Update

POST /Bucket001/6619810111 HTTP/1.1
x-amz-if-match: x-amz-meta-userdefined="0"

POST - Update

POST /Bucket001/6619810111 HTTP/1.1
x-amz-if-match: x-amz-meta-userdefined="0"

4) Conditional Copy
PUT - Copy

POST /Bucket001/6619810111 HTTP/1.1
x-amz-copy-source: /Bucket002/7719810100
x-amz-copy-source-if-match-on-meta: x-amz-meta-userdefined="0"

Work items

Coding tasks

  1. Task 1
  2. Task 2
  3. Task 3

Build / release tasks

  1. Task 1
  2. Task 2
  3. Task 3

Documentation tasks

  1. Task 1
  2. Task 2
  3. Task 3

Deprecation tasks

  1. Task 1
  2. Task 2
  3. Task 3