[ 
https://issues.apache.org/jira/browse/HDDS-16052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ivan Andika updated HDDS-16052:
-------------------------------
    Description: 
ContainerData#updateWriteStats is not atomic. It is updated for each 
WriteChunk, but WriteChunk is only serialized for a single block. If there are 
two concurrent WriteChunk for the same container, but with different blocks, 
this can trigger race conditions which can cause updateWriteStats to be 
interleaved which can end up causing inconsistency in ContainerData. We also 
need to specify the thread safety guarantee of ContainerData. 

Additionally, ContainerData is also has memory visibility issue since the 
shared variables like committedSpace is not volatile (or protected by 
synchronization), although ContainerData can be accessed by multiple threads.

  was:ContainerData#updateWriteStats is not atomic. It is updated for each 
WriteChunk, but WriteChunk is only serialized for a single block. If there are 
two concurrent WriteChunk for the same container, but with different blocks, 
this can trigger race conditions which can cause updateWriteStats to be 
interleaved which can end up causing inconsistency in ContainerData. We also 
need to specify the thread safety guarantee of ContainerData. 


> ContainerData updateWriteStats is not atomic
> --------------------------------------------
>
>                 Key: HDDS-16052
>                 URL: https://issues.apache.org/jira/browse/HDDS-16052
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Ivan Andika
>            Assignee: Ivan Andika
>            Priority: Major
>
> ContainerData#updateWriteStats is not atomic. It is updated for each 
> WriteChunk, but WriteChunk is only serialized for a single block. If there 
> are two concurrent WriteChunk for the same container, but with different 
> blocks, this can trigger race conditions which can cause updateWriteStats to 
> be interleaved which can end up causing inconsistency in ContainerData. We 
> also need to specify the thread safety guarantee of ContainerData. 
> Additionally, ContainerData is also has memory visibility issue since the 
> shared variables like committedSpace is not volatile (or protected by 
> synchronization), although ContainerData can be accessed by multiple threads.



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