You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/07/18 14:18:09 UTC

[GitHub] [ozone] adoroszlai opened a new pull request, #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

adoroszlai opened a new pull request, #5084:
URL: https://github.com/apache/ozone/pull/5084

   ## What changes were proposed in this pull request?
   
   HDDS-8698 introduced a hard limit on EC pipeline count.  This may be too restrictive, since a few bad nodes could spoil all pipelines.
   
   The problem can happen in the time period between datanode failure and SCM marking it as dead, closing its related pipelines.  In this case client trying to write to a failed datanode detects the failure sooner than SCM does.  It requests a new block, excluding the failed datanode.  If all existing pipelines are excluded due to such failure, client encounters block allocation failure, then gives up.
   
   This PR proposes to turn the limit into a soft one, increasing the limit for the final attempt (after searching through all existing pipelines) to the number of datanodes.  (This only affects small clusters with few disks per node.  The problem may exist in larger clusters, too, and we may need to fine-tune this rule later.)
   
   https://issues.apache.org/jira/browse/HDDS-9033
   
   ## How was this patch tested?
   
   Tested manually in `ozone-topology` environment:
   
    * create 5 EC keys (creates new container for each)
    * find a datanode that is part of all 5 pipelines
    * stop the datanode
    * try to create another EC key
   
   Client output shows write failure, but succeeds eventually:
   
   ```
   WARN io.KeyOutputStream: EC stripe write failed: S S F S S
   ```
   
   SCM debug log indicates pipeline limit was hit:
   
   ```
   scm_1         | 2023-07-18 09:49:35,216 [IPC Server handler 2 on default port 9863] DEBUG pipeline.WritableECContainerProvider: Pipeline count 5 reached limit 5, checking existing ones; requested size=268435456, replication=EC{rs-3-2-1024k}, owner=om1, ExcludeList {datanodes = [0c764f3f-ac11-4757-8a20-bb379dbabfa8(null/null)], containerIds = [], pipelineIds = [PipelineID=fa15da28-8d55-4b6e-aad6-dc5898b4c92e]}
   scm_1         | 2023-07-18 09:49:35,216 [IPC Server handler 2 on default port 9863] DEBUG pipeline.WritableECContainerProvider: Checking existing pipelines: []
   scm_1         | 2023-07-18 09:49:35,216 [IPC Server handler 2 on default port 9863] DEBUG pipeline.WritableECContainerProvider: Increasing pipeline limit 5 -> 6 for final attempt
   scm_1         | 2023-07-18 09:49:35,228 [IPC Server handler 2 on default port 9863] INFO pipeline.WritableECContainerProvider: Created and opened new pipeline Pipeline[ Id: 8052e76e-a184-43f5-afa3-9532c88d3275, Nodes: 618d8a2e-64f2-421e-9269-2e3cb1437542(ozone-topology_datanode_3_1.ozone-topology_net/10.5.0.6)90b392fa-95bf-4ea3-b2f7-43015451cfc7(ozone-topology_datanode_5_1.ozone-topology_net/10.5.0.8)38fc6c5a-fcd5-4819-97c5-468ec4648e19(ozone-topology_datanode_4_1.ozone-topology_net/10.5.0.7)5059a97c-bd7c-4819-832f-41ac0d5b4c7f(ozone-topology_datanode_1_1.ozone-topology_net/10.5.0.4)5b2b6e9d-d67e-4c39-aa85-57066d69154f(ozone-topology_datanode_2_1.ozone-topology_net/10.5.0.5), ReplicationConfig: EC{rs-3-2-1024k}, State:ALLOCATED, leaderId:, CreationTimestamp2023-07-18T09:49:35.218009Z[UTC]]
   ```
   
   Added unit test.
   
   CI:
   https://github.com/adoroszlai/hadoop-ozone/actions/runs/5586806884


-- 
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] siddhantsangwan commented on pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "siddhantsangwan (via GitHub)" <gi...@apache.org>.
siddhantsangwan commented on PR #5084:
URL: https://github.com/apache/ozone/pull/5084#issuecomment-1645428677

   The idea of increasing the maximum number of pipelines if all the existing ones have been excluded looks good to me. I have some thoughts on what the new limit should be. Setting it to number of healthy, in service datanodes makes sense, but there are edge cases where the maximum number of pipelines is already greater than the number of datanodes. 
   
   One such case is when there are 5 datanodes, and each datanode has 8 (or any number greater than the datanode count) volumes. In this case, the max is 8. In general, if the pipeline per volume factor or the number of volumes is high enough, then max pipelines will already be greater than the number of datanodes. 
   
   So, what should the new limit be? This is an edge case, and number of datanodes amount of pipelines already sounds high enough, so I'm good with the current change. Another simple option is `maximumPipelines + 5`.


-- 
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] adoroszlai commented on a diff in pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5084:
URL: https://github.com/apache/ozone/pull/5084#discussion_r1270340264


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -159,13 +160,21 @@ public ContainerInfo getContainer(final long size,
     // If we get here, all the pipelines we tried were no good. So try to
     // allocate a new one.
     try {
-      synchronized (this) {
-        if (openPipelineCount < maximumPipelines) {
+      if (openPipelineCount >= maximumPipelines) {
+        final int nodeCount = nodeManager.getNodeCount(null, null);
+        if (nodeCount > maximumPipelines) {
+          LOG.debug("Increasing pipeline limit {} -> {} for final attempt",
+              maximumPipelines, nodeCount);

Review Comment:
   The setting is not changed, increase applies only to this specific allocation attempt.



-- 
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] siddhantsangwan commented on pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "siddhantsangwan (via GitHub)" <gi...@apache.org>.
siddhantsangwan commented on PR #5084:
URL: https://github.com/apache/ozone/pull/5084#issuecomment-1650946860

   Thanks @umamaheswararao and @guohao-rosicky for the reviews.


-- 
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] adoroszlai commented on pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #5084:
URL: https://github.com/apache/ozone/pull/5084#issuecomment-1655435829

   Thanks @guohao-rosicky, @siddhantsangwan, @umamaheswararao 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] guohao-rosicky commented on pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "guohao-rosicky (via GitHub)" <gi...@apache.org>.
guohao-rosicky commented on PR #5084:
URL: https://github.com/apache/ozone/pull/5084#issuecomment-1648859153

   Thanks @adoroszlai work on this. I think it's a good 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] umamaheswararao commented on a diff in pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "umamaheswararao (via GitHub)" <gi...@apache.org>.
umamaheswararao commented on code in PR #5084:
URL: https://github.com/apache/ozone/pull/5084#discussion_r1270308822


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -159,13 +160,21 @@ public ContainerInfo getContainer(final long size,
     // If we get here, all the pipelines we tried were no good. So try to
     // allocate a new one.
     try {
-      synchronized (this) {
-        if (openPipelineCount < maximumPipelines) {
+      if (openPipelineCount >= maximumPipelines) {
+        final int nodeCount = nodeManager.getNodeCount(null, null);
+        if (nodeCount > maximumPipelines) {
+          LOG.debug("Increasing pipeline limit {} -> {} for final attempt",
+              maximumPipelines, nodeCount);

Review Comment:
   This seems like one time log and a valuable setting change happening. Is it make sense to bump this log level?



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -159,13 +160,21 @@ public ContainerInfo getContainer(final long size,
     // If we get here, all the pipelines we tried were no good. So try to
     // allocate a new one.
     try {
-      synchronized (this) {
-        if (openPipelineCount < maximumPipelines) {
+      if (openPipelineCount >= maximumPipelines) {
+        final int nodeCount = nodeManager.getNodeCount(null, null);
+        if (nodeCount > maximumPipelines) {
+          LOG.debug("Increasing pipeline limit {} -> {} for final attempt",
+              maximumPipelines, nodeCount);
+          maximumPipelines = nodeCount;

Review Comment:
   Still users may need to tune this value based on their cluster and ECReplication config. Let's using 10:4 will different number openpipeline per node vs using 3:2 will have different number of pipelines per node. Because number of node involve in a pipeline changes. It is hard to auto tune that. (Vague thought)But later we may want to think like 80% nodes max pipeline count limit or so. if we get the info like each DN openpipelines counts, then if 80%( just an argitrary number) nodes in the cluster already have that max open pipelines, then we are at cap of openpipelines limit. 



##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java:
##########
@@ -309,6 +309,10 @@ public List<DatanodeDetails> getNodes(
       return deadNodes;
     }
 
+    if (nodestate == null) {

Review Comment:
   oh it's because your passing null when calling getNodeCount?
   That means null makes it as any state.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -159,13 +160,21 @@ public ContainerInfo getContainer(final long size,
     // If we get here, all the pipelines we tried were no good. So try to
     // allocate a new one.
     try {
-      synchronized (this) {
-        if (openPipelineCount < maximumPipelines) {
+      if (openPipelineCount >= maximumPipelines) {

Review Comment:
   Should this exclude DECOMMISSIONED state nodes?
   
   What if more nodes take to offline mode? then this count puts the pressure on cluster with more openpipelines? ( May be rare case as people may not take many nodes at a time though )



##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java:
##########
@@ -309,6 +309,10 @@ public List<DatanodeDetails> getNodes(
       return deadNodes;
     }
 
+    if (nodestate == null) {

Review Comment:
   instead of passing null, getAllNodes().size() also works?



##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java:
##########
@@ -309,6 +309,10 @@ public List<DatanodeDetails> getNodes(
       return deadNodes;
     }
 
+    if (nodestate == null) {

Review Comment:
   What is the case nodestate is null?



-- 
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] siddhantsangwan merged pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "siddhantsangwan (via GitHub)" <gi...@apache.org>.
siddhantsangwan merged PR #5084:
URL: https://github.com/apache/ozone/pull/5084


-- 
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] adoroszlai commented on a diff in pull request #5084: HDDS-9033. Increase EC pipeline limit for final allocation attempt

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5084:
URL: https://github.com/apache/ozone/pull/5084#discussion_r1270374185


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java:
##########
@@ -159,13 +160,21 @@ public ContainerInfo getContainer(final long size,
     // If we get here, all the pipelines we tried were no good. So try to
     // allocate a new one.
     try {
-      synchronized (this) {
-        if (openPipelineCount < maximumPipelines) {
+      if (openPipelineCount >= maximumPipelines) {

Review Comment:
   Thanks, updated to only consider in-service healthy nodes.



-- 
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