rakeshadr opened a new pull request, #3544:
URL: https://github.com/apache/ozone/pull/3544

   ## What changes were proposed in this pull request?
   
   Race condition between async thread 
`OzoneManagerDoubleBuffer.flushTransactions()` and BucketDeleteRequest:
   
   **Case:**
   While processing `OMKeysDeleteResponseWithFSO` by  the 
`OzoneManagerDoubleBuffer.flushTransactions()` thread, response logic 
constructs "buck_Id" by querying BucketTable. Assume during this time, 
`DELETE_BUCKET`  request for this bucket "buck_Id" has been processed and 
updated the DB. Now, `OMKeysDeleteResponseWithFSO` will not see the bucket and 
throws NPE.
   
   **More Details:**
   OzoneClient: deleteBucket with recursive flag = true. Now, ozone client will 
splits this user call to multiple RPC calls to OM.
   step-1)List paths and deleteObjects.
   step-2)Finally deleteBucket
   
   **Preventive Action:**
   Action-1) Revisited all the Response classes. VolumeId and bucketId should 
be passed to all *Response* objects before sending response back to the client. 
This will avoid fetch bucketId from DB again and avoids NPE.
   Action-2) Validated bucketInfo and volumeInfo for the non-existent case and 
throws OMException.
   long getVolumeId(String volume) throws IOException;
   long getBucketId(String volume, String bucket) throws IOException;
   
   ```
   2022-06-22 11:53:30,901 Deleted all the keys and responded back to the ozone 
client after adding an OMKeysDeleteResponseWithFSO entry to the 
OzoneManagerDoubleBuffer
   2022-06-22 11:53:30,905  DeleteBucket call came for the  "vol_Id/buck_Id" 
and responded back to ozone client after adding an OMKeysDeleteResponseWithFSO 
entry to the OzoneManagerDoubleBuffer
   2022-06-22 11:53:30,907 OzoneManagerDoubleBuffer#flushTransactions  kicked 
in and picks up OMKeysDeleteResponseWithFSO entry. While processing it tries to 
construct "vol_Id/buck_Id/prefixId" inorder to delete the path from DirTable & 
FileTable.
   ```
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6934
   
   ## How was this patch tested?
   
   Added test cases.
   


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

To unsubscribe, e-mail: [email protected]

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