[ https://issues.apache.org/jira/browse/RATIS-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16917059#comment-16917059 ]
Lokesh Jain commented on RATIS-661: ----------------------------------- [~szetszwo] Thanks for reviewing the patch! | Why changing remove(..) to get(..) below? Since the impl is removed earlier, RaftServer#getGroupIds would not give the corresponding groupId even though the group has not yet been removed. RaftServer#getGroupIds is used in ozone datanode to know if pipeline exists or not. This can lead to race condition as pipeline may still be active even though it is reported as non-existent. | Just make the call there as below. I was thinking of keeping it this way so that we notify after all the transactions have been applied. {code:java} impl.shutdown(deleteDirectory); impl.getStateMachine().notifyGroupRemove();{code} > Add call in state machine to handle group removal > ------------------------------------------------- > > Key: RATIS-661 > URL: https://issues.apache.org/jira/browse/RATIS-661 > Project: Ratis > Issue Type: Bug > Reporter: Lokesh Jain > Assignee: Lokesh Jain > Priority: Major > Attachments: RATIS-661.001.patch, RATIS-661.002.patch, > RATIS-661.003.patch, RATIS-661.004.patch > > > Currently during RaftServerProxy#groupRemoveAsync there is no way for > stateMachine to know that the RaftGroup will be removed. This Jira aims to > add a call in the stateMachine to handle group removal. > It also changes the logic of groupRemoval api to remove the RaftServerImpl > from the RaftServerProxy#impls map after the shutdown is complete. This is > required to synchronize the removal with the corresponding api of > RaftServer#getGroupIds. RaftServer#getGroupIds uses the RaftServerProxy#impls > map to get the groupIds. -- This message was sent by Atlassian Jira (v8.3.2#803003)