3448: check block timestamp before DELETE
authorTim Pierce <twp@curoverse.com>
Thu, 21 Aug 2014 17:50:18 +0000 (13:50 -0400)
committerTim Pierce <twp@curoverse.com>
Thu, 21 Aug 2014 17:55:17 +0000 (13:55 -0400)
commit56d363875a42c1abd485c67e030f625299548aa0
tree39791f09b1a190844dbb658c4cb4a6fadabd8ad0
parent0b10fae767ce774b62a2bd2922a77578341d87e1
3448: check block timestamp before DELETE

volume.Delete locks the target file and checks the timestamp before
proceeding. If the file is newer than permission_ttl specifies, return a
PermissionError. This way, a block that has been marked for recycling by
Data Manager but subsequently was re-added by a user will not be
prematurely deleted.

PutBlock now updates the timestamp on the target block if it already
exists on disk, to prevent DELETE from recycling old blocks that have
just been refreshed.

To update block timestamps, the blob server uses the new volume.Touch
method.  MockVolume and UnixVolume have been updated appropriately.

Refs #3448.
services/keepstore/handlers.go
services/keepstore/volume.go
services/keepstore/volume_unix.go