[ 
https://issues.apache.org/jira/browse/HDDS-13599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18015693#comment-18015693
 ] 

Tsz-wo Sze commented on HDDS-13599:
-----------------------------------

In FilePerBlockStrategy, the readChunk(..), writeChunk(..) and deleteChunk(..) 
methods already take Container, BlockID and ChunkInfo as parameters.  But these 
methods resolve the path first and the access the file later.  They should be 
synchronized

{code}
  synchronized  <T> T access(Container container, BlockID blockID, ChunkInfo 
info,
      CheckedFunction<File, T, IOException> ioMethod) throws IOException {
    File chunkFile = getChunkFile(container, blockID, info);
    return ioMethod.apply(chunkFile);
  }
{code}

For read/write, the access method will return a FileChannel.   For delete, it 
could delete the file and return Void.

> Take write Lock of all block files before a container replica directory is 
> deleted
> ----------------------------------------------------------------------------------
>
>                 Key: HDDS-13599
>                 URL: https://issues.apache.org/jira/browse/HDDS-13599
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Sammi Chen
>            Priority: Major
>
> To avoid interim read failure caused by block file deleted during container 
> replica directory deletion. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to