Activity log for bug #1049017

Date Who What changed Old value New value Message
2012-09-11 09:36:12 Yukihiro KAWADA bug added bug
2012-09-11 09:38:01 Yukihiro KAWADA description We can not delete only metada of container. Example is case of StaticWeb: container=web file=web/index.html curl -v -X GET -H 'X-Storage-Token: AUTH_tk168fccd695e84f2693b6fc966cb69d14' http://172.20.113.13:8080/v1/AUTH_system/web < HTTP/1.1 200 OK < X-Container-Object-Count: 1 < X-Container-Meta-Web-Listing: true < X-Timestamp: 1347270749.13087 < X-Container-Read: .r:* < X-Container-Bytes-Used: 3686 < X-Container-Meta-Web-Index: index.html < Accept-Ranges: bytes < Content-Length: 11 < Content-Type: text/plain; charset=utf-8 < Date: Tue, 11 Sep 2012 09:15:35 GMT index.html Now I want to delete 'X-Container-Meta-Web-Index: index.html' field, but can not. I have no choice but to delete container 'web'. I can only delete all of container 'web' and metadata. My patch is very simple fix. If I set 'deleteme' to metadata value, then delete its metadata item curl -v -X PUT -H 'X-Container-Meta-Web-Index: deleteme' -H 'X-Storage-Token: AUTH_tk168fccd695e84f2693b6fc966cb69d14' http://172.20.113.13:8080/v1/AUTH_system/web < HTTP/1.1 200 OK < X-Container-Object-Count: 1 < X-Container-Meta-Web-Listing: true < X-Timestamp: 1347270749.13087 < X-Container-Read: .r:* < X-Container-Bytes-Used: 3686 < Accept-Ranges: bytes < Content-Length: 11 < Content-Type: text/plain; charset=utf-8 < Date: Tue, 11 Sep 2012 09:27:41 GMT index.html Thank you. === here is patch diff --git a/swift/common/db.py b/swift/common/db.py index 6b30db4..f6fd972 100644 --- a/swift/common/db.py +++ b/swift/common/db.py @@ -588,6 +588,9 @@ class DatabaseBroker(object): value, timestamp = value_timestamp if key not in md or timestamp > md[key][1]: md[key] = value_timestamp + ## if remove metadata item then set 'deleteme' to its header value + if value == 'deleteme': + del md[key] conn.execute('UPDATE %s_stat SET metadata = ?' % self.db_type, (json.dumps(md),)) conn.commit() === We can not delete only metada of container. Example is case of StaticWeb: container=web file=web/index.html curl -v -X GET -H 'X-Storage-Token: AUTH_tk168fccd695e84f2693b6fc966cb69d14' http://144.50.113.13:8080/v1/AUTH_system/web < HTTP/1.1 200 OK < X-Container-Object-Count: 1 < X-Container-Meta-Web-Listing: true < X-Timestamp: 1347270749.13087 < X-Container-Read: .r:* < X-Container-Bytes-Used: 3686 < X-Container-Meta-Web-Index: index.html < Accept-Ranges: bytes < Content-Length: 11 < Content-Type: text/plain; charset=utf-8 < Date: Tue, 11 Sep 2012 09:15:35 GMT index.html Now I want to delete 'X-Container-Meta-Web-Index: index.html' field, but can not. I have no choice but to delete container 'web'. I can only delete all of container 'web' and metadata. My patch is very simple fix. If I set 'deleteme' to metadata value, then delete its metadata item curl -v -X PUT -H 'X-Container-Meta-Web-Index: deleteme' -H 'X-Storage-Token: AUTH_tk168fccd695e84f2693b6fc966cb69d14' http://144.50.113.13:8080/v1/AUTH_system/web < HTTP/1.1 200 OK < X-Container-Object-Count: 1 < X-Container-Meta-Web-Listing: true < X-Timestamp: 1347270749.13087 < X-Container-Read: .r:* < X-Container-Bytes-Used: 3686 < Accept-Ranges: bytes < Content-Length: 11 < Content-Type: text/plain; charset=utf-8 < Date: Tue, 11 Sep 2012 09:27:41 GMT index.html Thank you. === here is patch diff --git a/swift/common/db.py b/swift/common/db.py index 6b30db4..f6fd972 100644 --- a/swift/common/db.py +++ b/swift/common/db.py @@ -588,6 +588,9 @@ class DatabaseBroker(object):                  value, timestamp = value_timestamp                  if key not in md or timestamp > md[key][1]:                      md[key] = value_timestamp + ## if remove metadata item then set 'deleteme' to its header value + if value == 'deleteme': + del md[key]              conn.execute('UPDATE %s_stat SET metadata = ?' % self.db_type,                           (json.dumps(md),))              conn.commit() ===
2012-09-11 09:42:35 Yukihiro KAWADA attachment added kwd_120911.patch https://bugs.launchpad.net/swift/+bug/1049017/+attachment/3307099/+files/kwd_120911.patch
2012-09-11 10:06:43 Alex Yang swift: status New Invalid
2012-09-12 15:11:00 gholt swift: status Invalid Confirmed
2012-09-13 00:32:14 Yukihiro KAWADA attachment removed kwd_120911.patch https://bugs.launchpad.net/swift/+bug/1049017/+attachment/3307099/+files/kwd_120911.patch
2012-09-13 02:05:32 Yukihiro KAWADA attachment added kwd_20120913.patch https://bugs.launchpad.net/swift/+bug/1049017/+attachment/3311500/+files/kwd_20120913.patch
2012-10-07 03:31:30 OpenStack Infra swift: status Confirmed In Progress
2012-10-07 03:31:30 OpenStack Infra swift: assignee Tom Fifield (fifieldt)
2012-10-11 17:35:46 OpenStack Infra swift: status In Progress Fix Committed
2012-11-07 15:51:44 Thierry Carrez swift: status Fix Committed Fix Released
2012-11-07 15:51:44 Thierry Carrez swift: milestone 1.7.5