From 2014cdb9066e273cf791f38b1c8247427c76cfa9 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Tue, 28 Jan 2014 12:13:33 +0530 Subject: Add support for Object Expiration feature Preventing access to expired objects ------------------------------------ Re-enabled accepting X-Delete-At and X-Delete-After headers. During a GET on an expired object, DiskFileExpired is raised by DiskFile class. This will result in object-server returning HTTPNotFound (404) to the client. Tracking objects to be deleted ------------------------------ Objects to be deleted are tracked using "tracker objects". These are PUT into a special account(a volume, for now). These zero size "tracker objects" have names that contain: * Expiration timestamp * Path of the actual object to be deleted Deleting actual objects from GlusterFS volume --------------------------------------------- The object-expirer daemon runs a pass once every X seconds. For every pass it makes, it queries the special account for "tracker objects". Based on (timestamp, path) present in name of "tracker objects", object-expirer then deletes the actual object and the corresponding tracker object. To run object-expirer forever: swift-init object-expirer start To run just once: swift-object-expirer -o -v /etc/swift/object-expirer.conf Caveat/Limitation: Object-expirer needs a separate account(volume) that is not used by other services like gswauth. By default, this volume is named "gsexpiring" and is configurable. More info about object expiration: http://docs.openstack.org/developer/swift/overview_expiring_objects.html Change-Id: I876995bf4f16ef4bfdff901561e0558ecf1dc38f Signed-off-by: Prashanth Pai Reviewed-on: http://review.gluster.org/6891 Tested-by: Chetan Risbud Reviewed-by: pushpesh sharma Tested-by: pushpesh sharma Reviewed-by: Chetan Risbud --- test/functional/gluster_swift_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/functional/gluster_swift_tests.py') diff --git a/test/functional/gluster_swift_tests.py b/test/functional/gluster_swift_tests.py index 0a721b6..2768f9d 100644 --- a/test/functional/gluster_swift_tests.py +++ b/test/functional/gluster_swift_tests.py @@ -59,6 +59,10 @@ class TestFile(Base): self.assertEquals(data,data_read) def testInvalidHeadersPUT(self): + #TODO: Although we now support x-delete-at and x-delete-after, + #retained this test case as we may add some other header to + #unsupported list in future + raise SkipTest() file = self.env.container.file(Utils.create_name()) self.assertRaises(ResponseError, file.write_random, @@ -72,6 +76,10 @@ class TestFile(Base): self.assert_status(400) def testInvalidHeadersPOST(self): + #TODO: Although we now support x-delete-at and x-delete-after, + #retained this test case as we may add some other header to + #unsupported list in future + raise SkipTest() file = self.env.container.file(Utils.create_name()) file.write_random(self.env.file_size) headers = file.make_headers(cfg={}) -- cgit