devmadhuu commented on code in PR #6360:
URL: https://github.com/apache/ozone/pull/6360#discussion_r1550186174
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/CommandQueue.java:
##########
@@ -141,6 +141,17 @@ public void addCommand(final UUID datanodeUuid, final
SCMCommand
commandsInQueue++;
}
+ /**
+ * Removes all Commands from the SCM Queue for the datanode.
+ *
+ * @param datanodeUuid DatanodeDetails.Uuid
+ */
+ public void removeCommand(final UUID datanodeUuid) {
Review Comment:
I can see that
`org.apache.hadoop.hdds.scm.node.SCMNodeManager#getCommandQueue` is being used
to get command list in DeadNodeHandler, but can't see that list is cleared off,
just logging the size of command list.
Also When we are adding a new command in
`org.apache.hadoop.hdds.scm.node.CommandQueue#addCommand`, we increment
`commandsInQueue` variable , so I think if we clear or remove commands from
command queue , we should decrement it atomically by taking write lock which is
being done in `org.apache.hadoop.hdds.scm.node.SCMNodeManager#removeNode`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]