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

Tsz-wo Sze edited comment on HDDS-13599 at 8/30/25 4:45 PM:
------------------------------------------------------------

{quote} Thread C will get the old path, because the "Container container" its 
hold get staled after new replica is added to DN in memory ContainerSet, the 
"Container container" its hold always points to the old path. 
{quote}
Thanks for pointing it out! When the container is moved, we should acquire the 
resolver lock and then update the volume, chunksPath and metadataPath in the 
Container object. Then, when Thread C resolves a chunk path (while holding 
resolver lock), it will get the new path.

It may make sense to use the Container object as the resolver lock.

Currently, the path management code is scattered in quite a few classes 
(KeyValueContainer, FilePerBlockStrategy, etc.) It would be great if we could 
refactor the code so that the path management is relocated to a single place.


was (Author: szetszwo):
bq. Thread C will get the old path, because the "Container container" its hold 
get staled after new replica is added to DN in memory ContainerSet, the 
"Container container" its hold always points to the old path. 

Thanks for pointing it out.  When the container is moved, we should update 
synchronously the volume, chunksPath and metadataPath in the old Container.  
Then, when Thread C resolves a chunk path, it will get the new path.

> 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
>         Attachments: screenshot-1.png
>
>
> 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