Project

General

Profile

Actions

Feature #8556

closed

[Keep] Implement trash/untrash behavior in azure_blob_volume

Added by Peter Amstutz about 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
Keep
Target version:
Story points:
2.0

Description

Implementation

  1. Trash → set <ExpiresAt>123</ExpiresAt> and create a marker (just an empty blob) named trash/000000000123/hash
  2. Untrash → unset ExpiresAt and delete trash/000000000123/hash
  3. EmptyTrash → index trash/* in order. For each trash marker with deadline <= now:
    • Look up the modtime and ExpiresAt for the data block itself.
    • If the data is still old and ExpiresAt is still set, delete the data block (otherwise do nothing).
    • Delete the trash marker (regardless of whether the data block was deleted).
  4. Get, Mtime, Touch, IndexTo → check ExpiresAt metadata. If present, return/skip as if the block was not found at all.

Tests / Acceptance Criteria

Ensure {Put; Trash; Put} results in ExpiresAt being cleared. This might happen by itself, or we might need to use SetBlobMetadata to clear the metadata explicitly after writing each block. (The test for this should already be in place, in the generic volume test: {Put; Backdate; Trash; Put; Backdate; empty trash}.)

Ensure the Azure server stub behaves the same as the real Azure server wrt any feature we're relying on for this. E.g., it's not enough to know that our stub clears the metadata when overwriting a block. We need to know that the real Azure service is documented to behave that way, and actually does behave that way (e.g., via manual testing with real Azure containers).

All existing tests in volume_generic_test must pass, even when "Trash with trashLifetime>0" is implemented.

In the first set of testTrashEmptyTrashUntrash, with trashLifetime>0, after the "Get() returns notfound", check:
  • Mtime → notfound
  • Compare → notfound
  • IndexTo does not include the trashed block
  • Touch → notfound
In the first set of testTrashEmptyTrashUntrash, with trashLifetime>0, after the "Get() returns data after Untrash()", check:
  • Mtime → ok
  • Compare → ok
  • IndexTo includes the block
  • Touch → ok
In testDeleteOldBlock(), after checking v.Get(TestHash), check:
  • Mtime → notfound
  • Compare → notfound
  • IndexTo does not include the trashed block
  • Touch → notfound

Future work (defer)

When doing a full index (prefix=""), build two trash lists: a list of blocks whose metadata indicates that they are trash, and a list of trash markers. After sending the index response and closing the connection, delete any trash markers whose block metadata indicates that they are not trash.


Subtasks 1 (0 open1 closed)

Task #8740: Review branch 8556-trash-untrash-azure-volumeResolvedRadhika Chippada05/05/2016Actions

Related issues

Related to Arvados - Idea #8178: [Keepstore] Implement interfaces trash area and undelete endpointResolvedRadhika Chippada01/11/2016Actions
Blocked by Arvados - Idea #8833: [Keep] Azure SDK update to add metadata to ListBlobs callResolvedRadhika Chippada04/28/2016Actions
Actions

Also available in: Atom PDF