You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/07/19 12:49:53 UTC
[GitHub] [ozone] JacksonYao287 opened a new pull request #2435: Move dead DN out of topology
JacksonYao287 opened a new pull request #2435:
URL: https://github.com/apache/ozone/pull/2435
## What changes were proposed in this pull request?
Move dead DN out of topology
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-5437
## How was this patch tested?
unit test
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sodonnel merged pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
sodonnel merged pull request #2435:
URL: https://github.com/apache/ozone/pull/2435
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678779462
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
thanks @sodonnel for the review!
>How does this change test this feature?
```
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
.....
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
......
}
```
this is the current code in `NodeStateManager`, and it is the only place where a `DEAD` event is fired and `DeadNodeHandler` is called. So we can see here when judging the state of all the nodes , we get all the DatanodeInfos from `nodeStateMap` directly. when a datonode registers itself to scm, it will be added to `nodeStateMap`. but let us see `nodeStateMap#add`.
```
public void addNode(......)
...........
nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus,
layoutInfo));
............
}
```
we can see that a new object is created here and added to the map, **so the point here is that, the registered `DatanodeDetails` is not the one which is stored is `nodeMap` and got by `DeadNodeHandler` when `DEAD` event is fired** . when running test , it will lead to the failure of ` Preconditions.checkState` in `DeadNodeHandler`. so i think the current test code does not notice this , and this is why the change here is made.
>I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
yea , although i have add a ` Preconditions.checkState` in the handlers , i think it`s better off adding this . i will do it
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sodonnel merged pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
sodonnel merged pull request #2435:
URL: https://github.com/apache/ozone/pull/2435
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-882627123
@ChenSammi @sodonnel PTAL, thanks!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678779462
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
thanks @sodonnel for the review!
>How does this change test this feature?
```
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
.....
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
......
}
```
this is the current code in `NodeStateManager#checkNodesHealth`, and it is the only place where a `DEAD` event is fired and `DeadNodeHandler` is called. So we can see here when judging the state of all the nodes , we get all the DatanodeInfos from `nodeStateMap` directly. when a datonode registers itself to scm, it will be added to `nodeStateMap`. but let us see `nodeStateMap#add`.
```
public void addNode(......)
...........
nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus,
layoutInfo));
............
}
```
we can see that a new object is created here and added to the map, **so the point here is that, the registered `DatanodeDetails` is not the one which is stored in `nodeMap` and got by `DeadNodeHandler` when `DEAD` event is fired** . when running test , it will lead to the failure of ` Preconditions.checkState` in `DeadNodeHandler`. so i think the current test code does not notice this , and this is why the change here is made.
>I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
yea , although i have add a ` Preconditions.checkState` in the handlers , i think it`s better off adding this . i will do it
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-899961308
@sodonnel @ChenSammi can you please take a look?
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-887355495
> @JacksonYao287 LGTM
thank @dineshchitlangia for the review!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678779462
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
thanks @sodonnel for the review!
>How does this change test this feature?
```
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
.....
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
......
}
```
this is the current code in `NodeStateManager`, and it is the only place where a `DEAD` event is fired and `DeadNodeHandler` is called. So we can see here when judging the state of all the nodes , we get all the DatanodeInfos from `nodeStateMap` directly. when a datonode registers itself to scm, it will be added to `nodeStateMap`. but let us see `nodeStateMap#add`.
```
public void addNode(......)
...........
nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus,
layoutInfo));
............
}
```
we can see that a new object is created here and added to the map, so the point here is that, the registered `DatanodeDetails` is not the one which is stored is `nodeMap` and got by `DeadNodeHandler` when `DEAD` event is fired . when running test , it will lead to the failure of ` Preconditions.checkState` in `DeadNodeHandler`. so i think the current test code does not notice this , and this is why the change here is made.
>I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
yea , although i have add a ` Preconditions.checkState` in the handlers , i think it`s better off adding this . i will do it
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-900141512
seems a flaky case, not caused by this patch
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-888059635
@ChenSammi PTAL, thanks!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-887240050
thanks @ChenSammi for the review!
>Precondition check that
>after DN is removed from topology, DatanodeDetails instance returned from nodeStateManager has no parent.
>after DN is added back into topology, DatanodeDetails instance returned from nodeStateManager has parent correctly set.
>And would you add a new UT for it.
i will make this change
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] ChenSammi commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
ChenSammi commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-886335962
Thanks @JacksonYao287 for working on this.
When a DN registered, the DatanodeDetails instance which presents DN is added into both Topology tree and nodeStateManager. nodeStateManager is used more frequently than Topology to get a DN's info. Would you add a Precondition check that
1. after DN is removed from topology, DatanodeDetails instance returned from nodeStateManager has no parent.
2. after DN is added back into topology, DatanodeDetails instance returned from nodeStateManager has parent correctly set.
And would you add a new UT for it.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-900753011
thanks @sodonnel for the review
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678779462
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
thanks @sodonnel for the review!
>How does this change test this feature?
```
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
.....
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
......
}
```
this is the current code in `NodeStateManager`, and it is the only place where a `DEAD` event is fired and `DeadNodeHandler` is called. So we can see here when judging the state of all the nodes , we get all the DatanodeInfos from `nodeStateMap` directly. when a datonode registers itself to scm, it will be added to `nodeStateMap`. but let us see `nodeStateMap#add`.
```
public void addNode(......)
...........
nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus,
layoutInfo));
............
}
```
we can see that a new object is created here and added to the map, so the point here is that, the registered `DatanodeDetails` is not the one which is stored is `nodeMap` and got by `DeadNodeHandler` when `DEAD` event is fired . so i think the current test code does not notice this , and this is why the change here is made.
>I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
yea , although i have add a ` Preconditions.checkState` in the handlers , i think it`s better off adding this . i will do it
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-900753011
thanks @sodonnel for the review
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-882627123
@ChenSammi @sodonnel PTAL, thanks!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678779462
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
thanks @sodonnel for the review!
>How does this change test this feature?
```
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
.....
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
......
}
```
this is the current code in `NodeStateManager`, and it is the only place where a `DEAD` event is fired and `DeadNodeHandler` is called. So we can see here when judging the state of all the nodes , we get all the DatanodeInfos from `nodeStateMap` directly. when a datonode registers itself to scm, it will be added to `nodeStateMap`. but let us see `nodeStateMap#add`.
```
public void addNode(......)
...........
nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus,
layoutInfo));
............
}
```
we can see that a new object is created here and added to the map, so the point here is that, the registered `DatanodeDetails` is not the one which is stored is `nodeMap` and got by `DeadNodeHandler` when `DEAD` event is fired . in this patch , this will lead to the failure of ` Preconditions.checkState` in `DeadNodeHandler`. so i think the current test code does not notice this , and this is why the change here is made.
>I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
yea , although i have add a ` Preconditions.checkState` in the handlers , i think it`s better off adding this . i will do it
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#issuecomment-882627123
@ChenSammi @sodonnel PTAL, thanks!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678779462
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
thanks @sodonnel for the review!
>How does this change test this feature?
```
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
.....
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
......
}
```
this is the current code in `NodeStateManager`, and it is the only place where a `DEAD` event is fired and `DeadNodeHandler` is called. So we can see here when judging the state of all the nodes , we get all the DatanodeInfos from `nodeStateMap` directly. when a datonode registers itself to scm, it will be added to `nodeStateMap`. but let us see `nodeStateMap#add`.
```
public void addNode(......)
...........
nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus,
layoutInfo));
............
}
```
we can see that a new object is created here and added to the map, so the registered `DatanodeDetails` is not the one which is stored is `nodeMap` and got by `DeadNodeHandler` when `DEAD` event is fired . so i think the current test code does not notice this , and this is why the change here is made.
>I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
yea , although i have add a ` Preconditions.checkState` in the handlers , i think it`s better off adding this . i will do it
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sodonnel commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
sodonnel commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678118997
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
How does this change test this feature? I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2435: HDDS-5437. Move dead DN out of topology
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2435:
URL: https://github.com/apache/ozone/pull/2435#discussion_r678779462
##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestDeadNodeHandler.java
##########
@@ -212,6 +208,7 @@ public void testOnMessage() throws Exception {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
Review comment:
thanks @sodonnel for the review!
>How does this change test this feature?
```
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
.....
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
......
}
```
this is the current code in `NodeStateManager#checkNodesHealth`, and it is the only place where a `DEAD` event is fired and `DeadNodeHandler` is called. So we can see here when judging the state of all the nodes , we get all the DatanodeInfos from `nodeStateMap` directly. when a datonode registers itself to scm, it will be added to `nodeStateMap`. but let us see `nodeStateMap#add`.
```
public void addNode(......)
...........
nodeMap.put(id, new DatanodeInfo(datanodeDetails, nodeStatus,
layoutInfo));
............
}
```
we can see that a new object is created here and added to the map, **so the point here is that, the registered `DatanodeDetails` is not the one which is stored is `nodeMap` and got by `DeadNodeHandler` when `DEAD` event is fired** . when running test , it will lead to the failure of ` Preconditions.checkState` in `DeadNodeHandler`. so i think the current test code does not notice this , and this is why the change here is made.
>I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired.
yea , although i have add a ` Preconditions.checkState` in the handlers , i think it`s better off adding this . i will do it
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org