Rgw - If-Match on user-defined metadata » History » Version 2
Jessica Mack, 07/01/2015 04:20 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 | 2 | Jessica Mack | * Conditional Read: Similar to the HTTP "conditional GET":http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3 |
27 | 1 | Jessica Mack | * 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 | 2 | Jessica Mack | * Conditional Update: It brings "test-and-set on PUT/POST":http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24 semantics to S3 API. |
29 | * Conditional Copy: Similar to the "S3 Copy Object API":http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html. |
||
30 | 1 | Jessica Mack | |
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 | 2 | Jessica Mack | h4. %{color:grey}1) Conditional Read |
36 | GET Object% |
||
37 | |||
38 | 1 | Jessica Mack | GET /Bucket001/6619810111 HTTP/1.1 |
39 | x-amz-if-match: x-amz-meta-userdefined="0" |
||
40 | |||
41 | 2 | Jessica Mack | h4. %{color:grey}2) Conditional Delete |
42 | DELETE Object% |
||
43 | |||
44 | 1 | Jessica Mack | DELETE /Bucket001/6619810111 HTTP/1.1 |
45 | x-amz-if-match: x-amz-meta-userdefined="0" |
||
46 | |||
47 | 2 | Jessica Mack | h4. %{color:grey}Multi-Object Delete% |
48 | 1 | Jessica Mack | |
49 | 2 | Jessica Mack | <pre> |
50 | 1 | Jessica Mack | POST /Bucket001?delete HTTP/1.1 |
51 | <Delete> |
||
52 | <Object> |
||
53 | <Key>6619810111</Key> |
||
54 | <If-Match> |
||
55 | <Key>x-amz-meta-userdefined</key> |
||
56 | <Value>0</Value> |
||
57 | </If-Match> |
||
58 | </Object> |
||
59 | <Delete> |
||
60 | |||
61 | POST /Bucket001?delete HTTP/1.1 |
||
62 | <Delete> |
||
63 | <Object> |
||
64 | <Key>6619810111</Key> |
||
65 | <If-Match key="x-amz-meta-userdefined" value="0"/> |
||
66 | </Object> |
||
67 | <Delete> |
||
68 | 2 | Jessica Mack | </pre> |
69 | 1 | Jessica Mack | |
70 | 2 | Jessica Mack | h4. %{color:grey}3) Conditional Update |
71 | PUT - Update% |
||
72 | |||
73 | 1 | Jessica Mack | POST /Bucket001/6619810111 HTTP/1.1 |
74 | x-amz-if-match: x-amz-meta-userdefined="0" |
||
75 | |||
76 | 2 | Jessica Mack | h4. %{color:grey}POST - Update% |
77 | |||
78 | 1 | Jessica Mack | POST /Bucket001/6619810111 HTTP/1.1 |
79 | x-amz-if-match: x-amz-meta-userdefined="0" |
||
80 | |||
81 | 2 | Jessica Mack | h4. %{color:grey}4) Conditional Copy |
82 | PUT - Copy% |
||
83 | |||
84 | 1 | Jessica Mack | POST /Bucket001/6619810111 HTTP/1.1 |
85 | x-amz-copy-source: /Bucket002/7719810100 |
||
86 | x-amz-copy-source-if-match-on-meta: x-amz-meta-userdefined="0" |
||
87 | |||
88 | h3. Work items |
||
89 | |||
90 | h4. Coding tasks |
||
91 | |||
92 | # Task 1 |
||
93 | # Task 2 |
||
94 | # Task 3 |
||
95 | |||
96 | h4. Build / release tasks |
||
97 | |||
98 | # Task 1 |
||
99 | # Task 2 |
||
100 | # Task 3 |
||
101 | |||
102 | h4. Documentation tasks |
||
103 | |||
104 | # Task 1 |
||
105 | # Task 2 |
||
106 | # Task 3 |
||
107 | |||
108 | h4. Deprecation tasks |
||
109 | |||
110 | # Task 1 |
||
111 | # Task 2 |
||
112 | # Task 3 |