Project

General

Profile

Rgw - If-Match on user-defined metadata » History » Version 1

Jessica Mack, 07/01/2015 12:16 AM

1 1 Jessica Mack
h1. Rgw - If-Match on user-defined metadata
2
3
h3. Summary
4
5
This is a proposal to add "If-Match" checking on user-defined metadata in RADOSGW.
6
7
h3. Owners
8
9
* Ray Lv (Yahoo)
10
* Name (Affiliation)
11
* Name
12
13
h3. Interested Parties
14
15
* Name (Affiliation)
16
* Name (Affiliation)
17
* Name
18
19
h3. Current Status
20
21
The current RADOSGW supports the HTTP "If-Match"/"If-None-Match" semantics on ETag.
22
23
h3. Detailed Description
24
25
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.
26
* Conditional Read: Similar to the HTTP ""conditional GET"":http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3
27
* 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.
28
* Conditional Update: It brings test-and-set on PUT/POST semantics to S3 API.
29
* Conditional Copy: Similar to the S3 Copy Object API.
30
31
h4. Interfaces
32
33
"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.
34
35
1) Conditional Read
36
GET Object
37
GET /Bucket001/6619810111 HTTP/1.1
38
x-amz-if-match: x-amz-meta-userdefined="0"
39
 
40
2) Conditional Delete
41
DELETE Object
42
DELETE /Bucket001/6619810111 HTTP/1.1
43
x-amz-if-match: x-amz-meta-userdefined="0"
44
 
45
Multi-Object Delete
46
 
47
POST /Bucket001?delete HTTP/1.1
48
<Delete>
49
 <Object>
50
   <Key>6619810111</Key>
51
   <If-Match>
52
     <Key>x-amz-meta-userdefined</key>
53
     <Value>0</Value>
54
   </If-Match>
55
 </Object>
56
<Delete>
57
 
58
POST /Bucket001?delete HTTP/1.1
59
<Delete>
60
 <Object>
61
   <Key>6619810111</Key>
62
   <If-Match key="x-amz-meta-userdefined" value="0"/>
63
 </Object>
64
<Delete>
65
 
66
3) Conditional Update
67
PUT - Update
68
POST /Bucket001/6619810111 HTTP/1.1
69
x-amz-if-match: x-amz-meta-userdefined="0"
70
 
71
POST - Update
72
POST /Bucket001/6619810111 HTTP/1.1
73
x-amz-if-match: x-amz-meta-userdefined="0"
74
 
75
4) Conditional Copy
76
PUT - Copy
77
POST /Bucket001/6619810111 HTTP/1.1
78
x-amz-copy-source: /Bucket002/7719810100
79
x-amz-copy-source-if-match-on-meta:  x-amz-meta-userdefined="0"
80
81
h3. Work items
82
83
h4. Coding tasks
84
85
# Task 1
86
# Task 2
87
# Task 3
88
89
h4. Build / release tasks
90
91
# Task 1
92
# Task 2
93
# Task 3
94
95
h4. Documentation tasks
96
97
# Task 1
98
# Task 2
99
# Task 3
100
101
h4. Deprecation tasks
102
103
# Task 1
104
# Task 2
105
# Task 3