Project

General

Profile

Feature #8556

Updated by Radhika Chippada about 8 years ago

h2. Implementation 

 # Trash &rarr; set @<ExpiresAt>123</ExpiresAt>@ *and* create a marker (just an empty blob) named @trash/000000000123/hash@ 
 # Untrash &rarr; unset @ExpiresAt@ *and* delete trash/000000000123/hash 
 # EmptyTrash &rarr; 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). 
 # Get, Mtime, Touch, IndexTo &rarr; check @ExpiresAt@ metadata. If present, return/skip as if the block was not found at all. 

 h2. Tests 

 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. 

 Ensure the Azure server stub behaves the same as the real Azure server wrt any feature we're relying on for this. 

 h2. Acceptance Criteria 

 * All existing tests in volume_generic_test must pass 
 ** Put, Get, Trash, Get err, Put, Get sequence (which we specifically want to test for Azure) is already covered in this test. So, we just need to verify that it passes, than adding an additional test. 

 * Add new test in volume_generic_test: 
 ** put block and get -> ok 
 ** With trashLifetime > 0:  
 *** 	 trash -> ok 
 *** 	 get -> err  
 *** 	 Mtime -> err  
 *** 	 Touch -> err 
 *** 	 Compare -> err 
 *** 	 IndexTo -> does not include the trashed block 
 ***  
 *** 	 untrash -> ok 
 *** 	 get -> ok 
 *** 	 Mtime -> ok 
 *** 	 Touch -> ok 
 *** 	 Compare -> ok 
 *** 	 IndexTo -> includes the block 
 ** With trashLifetime = 0:    (Block is deleted in this case and can’t be untrashed anymore. We do not actually have test/s that check all methods on a trashed block) 
 *** 	 trash -> ok 
 *** 	 get -> err  
 *** 	 Mtime -> err  
 *** 	 Touch -> err 
 *** 	 Compare -> err 
 *** 	 IndexTo -> does not include the trashed block 

 * Any specific verifications to be done for “Ensure the Azure server stub behaves the same as the real Azure server wrt any feature we're relying on for this”? How? 

 h2. 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. 

Back