avijayanhwx commented on a change in pull request #2015:
URL: https://github.com/apache/ozone/pull/2015#discussion_r591761689
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java
##########
@@ -278,10 +292,21 @@ private void initializeStateMachines() {
* @throws NodeAlreadyExistsException if the node is already present
*/
public void addNode(DatanodeDetails datanodeDetails,
- LayoutVersionProto layoutInfo)
- throws NodeAlreadyExistsException {
+ LayoutVersionProto layoutInfo) throws NodeAlreadyExistsException {
NodeStatus newNodeStatus = newNodeStatus(datanodeDetails);
nodeStateMap.addNode(datanodeDetails, newNodeStatus, layoutInfo);
+ UUID dnID = datanodeDetails.getUuid();
+ try {
+ updateLastKnownLayoutVersion(datanodeDetails, layoutInfo);
Review comment:
Just an alternative suggestion, can we init state as HEALTHY for the
Datanode, and move it to READONLY based on the alternative condition
(layoutMismatch)? It is more likely for a new DN to be in a correct rather than
a wrong layout version.
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java
##########
@@ -278,10 +292,21 @@ private void initializeStateMachines() {
* @throws NodeAlreadyExistsException if the node is already present
*/
public void addNode(DatanodeDetails datanodeDetails,
- LayoutVersionProto layoutInfo)
- throws NodeAlreadyExistsException {
+ LayoutVersionProto layoutInfo) throws NodeAlreadyExistsException {
NodeStatus newNodeStatus = newNodeStatus(datanodeDetails);
nodeStateMap.addNode(datanodeDetails, newNodeStatus, layoutInfo);
+ UUID dnID = datanodeDetails.getUuid();
+ try {
+ updateLastKnownLayoutVersion(datanodeDetails, layoutInfo);
Review comment:
Do we need to add a state == HEALTHY_READONLY check here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]