cxorm opened a new pull request #958:
URL: https://github.com/apache/hadoop-ozone/pull/958


   ## What changes were proposed in this pull request?
   
   This PR composed of changes including:
     - provide trash-enabled config when creating buckets.
     - provide recover-window config when creating buckets.
     - global config of above settings.
     - core logic of recovering trash to existing buckets.
   
   
   ### Proposed fix.
     - In `OmMetadataManagerImpl#getPendingDeletionKeys` we only check last 
item in repeatedOmKeyInfo.
       Cause once the last item is trash-enabled, we keep this key from purging 
in OM DB.
       > If the life time of key in deletedTable is less than recoverWindow, we 
didn't purge it in this time.
       > So we use the difference between currentTime and modificationTime of 
key to check the situation.
   
     - Using **trashTable** to track trash.
       > In part of deleting key,
       > add cache-update of trashTable in `OMKeyDeleteRequest` and 
DB-operation of trashTable in `OMKeyDeleteResponse`
       
       > In part of recovering trash,
       
       > for `OMTrashRecoverRequest`
       > remove OMKeyInfo in RepeatedOmKeyInfo from cache of trashTable and 
deletedTable.
         **(not remove all RepeatedOmKeyInfo.)**
       > add OMKeyInfo to cache of keyTable.
       
       > for `OMTrashRecoverResponse`
       > remove OMKeyInfo in RepeatedOmKeyInfo of trashTable and deletedTable 
in OM DB.
       > add OMKeyInfo to KeyTable in OM DB.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-2426
   
   ## How was this patch tested?
   Add UTs to track the OMTrashRecoverRequest and OMTrashRecoverResponse.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to