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

Lokesh Jain commented on HDDS-179:
----------------------------------

[~shashikant] Thanks for working on this! The patch looks good to me. Please 
find my comments below.
 # 
{code:java}
stateMachineMap.computeIfAbsent(requestProto.getContainerID(),
    k -> new StateMachineHelper());
{code}
We can do this operation in startTransaction when we are executing the 
CreateContainerCommand. This way we do not have to check it in every 
writeStateMachineData and applyTransaction operation.
 # We are currently not making sure that while CloseContainer is waiting no 
further writeChunks are executed. Maybe we need another boolean field in 
StateMachineHelper for that purpose.
 # I have another proposal for CloseContainer which is similar to what is 
currently done for writeChunk and createContainer. We can add a future for 
CloseContainer in writeStateMachine data. We can maintain a counter for each 
container which is incremented on start of writeChunk op and is reduced when it 
completes. On reduction if the counter reaches 0 the close container 
stateMachine future can be completed which would lead to execution of 
closeContainer op. This way we do not need a per container writeChunk map.
 # ContainerStateMachine:351-355 can be moved to handleCloseContainer.
 # ContainerStateMachine:415 - We should also check whether the size of 
writeChunkFutureMap >0
 # Minor comment. Should we rename StateMachineHelper to ContainerStateHelper 
or sth like that to give more clarity?
 # ContainerStateMachine:210 redundant change.
 # Lets move the VisibleForTesting fns to end of the class.

> CloseContainer command should be executed only if all the  prior "Write" type 
> container requests get executed
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HDDS-179
>                 URL: https://issues.apache.org/jira/browse/HDDS-179
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Client, Ozone Datanode
>            Reporter: Shashikant Banerjee
>            Assignee: Shashikant Banerjee
>            Priority: Major
>             Fix For: 0.2.1
>
>         Attachments: HDDS-179.01.patch, HDDS-179.02.patch, HDDS-179.03.patch, 
> HDDS-179.04.patch, HDDS-179.05.patch, HDDS-179.06.patch, HDDS-179.07.patch
>
>
> When a close Container command request comes to a Datanode (via SCM hearbeat 
> response) through the Ratis protocol, all the prior enqueued "Write" type of 
> request like  WriteChunk etc should be executed first before CloseContainer 
> request gets executed. This synchronization needs to be handled in the 
> containerStateMachine. This Jira aims to address this.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to