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 2022/07/28 02:54:42 UTC
[GitHub] [ozone] JacksonYao287 opened a new pull request, #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
JacksonYao287 opened a new pull request, #3634:
URL: https://github.com/apache/ozone/pull/3634
## What changes were proposed in this pull request?
Implement Ratis Container healthCheck, the first step for refactoring legacy RM.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7058
## 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 commented on pull request #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
Posted by GitBox <gi...@apache.org>.
sodonnel commented on PR #3634:
URL: https://github.com/apache/ozone/pull/3634#issuecomment-1265197963
@JacksonYao287 I was wondering if you are able to come back to this PR in the near future? We have made good progress with the new RM in recent weeks and it would be good to get it in. It does need a bit of a refactor as we change things around a little in RM, but the core logic will be the same.
--
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 pull request #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
Posted by GitBox <gi...@apache.org>.
sodonnel commented on PR #3634:
URL: https://github.com/apache/ozone/pull/3634#issuecomment-1241721336
We are refactoring how the container checks are performed in RM in #3743, so once that goes in this one will need refactored to fit into the new way of working.
--
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 pull request #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
Posted by GitBox <gi...@apache.org>.
sodonnel commented on PR #3634:
URL: https://github.com/apache/ozone/pull/3634#issuecomment-1270312413
I submitted a new PR for this one in #3802 using the changes here as a starting point and then refactored to fit into the new framework
--
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 closed pull request #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
Posted by GitBox <gi...@apache.org>.
JacksonYao287 closed pull request #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
URL: https://github.com/apache/ozone/pull/3634
--
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 #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
Posted by GitBox <gi...@apache.org>.
umamaheswararao commented on code in PR #3634:
URL: https://github.com/apache/ozone/pull/3634#discussion_r952814919
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/RatisContainerHealthCheck.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.hadoop.hdds.scm.container.replication;
+
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
+import org.apache.hadoop.hdds.scm.ContainerPlacementStatus;
+import org.apache.hadoop.hdds.scm.PlacementPolicy;
+import org.apache.hadoop.hdds.scm.container.ContainerInfo;
+import org.apache.hadoop.hdds.scm.container.ContainerReplica;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * Class to determine the health state of a Ratis Container. Given the container
+ * and current replica details, along with replicas pending add and delete,
+ * this class will return a ContainerHealthResult indicating if the container
+ * is healthy, or under / over replicated etc.
+ */
+public class RatisContainerHealthCheck implements ContainerHealthCheck {
+ public static final Logger LOG =
+ LoggerFactory.getLogger(RatisContainerHealthCheck.class);
+
+ /**
+ * PlacementPolicy which is used to identify where a container
+ * should be replicated.
+ */
+ private final PlacementPolicy ratisContainerPlacement;
+
+ public RatisContainerHealthCheck(final PlacementPolicy containerPlacement) {
+ this.ratisContainerPlacement = containerPlacement;
+ }
+
+ @Override
+ public ContainerHealthResult checkHealth(ContainerInfo container,
+ Set<ContainerReplica> replicas,
+ List<ContainerReplicaOp> replicaPendingOps,
+ int remainingRedundancyForMaintenance) {
+ int pendingAdd = 0;
+ int pendingDelete = 0;
+ for (ContainerReplicaOp op : replicaPendingOps) {
+ if (op.getOpType() == ContainerReplicaOp.PendingOpType.ADD) {
+ pendingAdd++;
+ } else if (op.getOpType() == ContainerReplicaOp.PendingOpType.DELETE) {
+ pendingDelete++;
+ } else {
+ LOG.warn("unknown opType of op : {}", op);
+ //TODO: return an appropriate state
+ return new ContainerHealthResult.UnHealthyResult(container);
+ }
+ }
+ int requiredNodes = container.getReplicationConfig().getRequiredNodes();
+
+ RatisContainerReplicaCount replicaCount =
+ new RatisContainerReplicaCount(container, replicas, pendingAdd,
+ pendingDelete, requiredNodes, remainingRedundancyForMaintenance);
+
+ ContainerPlacementStatus placementStatus =
+ getPlacementStatus(replicas, requiredNodes);
+
+ boolean sufficientlyReplicated = replicaCount.isSufficientlyReplicated();
+ boolean isPolicySatisfied = placementStatus.isPolicySatisfied();
+ if (!sufficientlyReplicated || !isPolicySatisfied) {
Review Comment:
Probably misreplicated state should be given low priority compared to Underplicated state. So, is it make sense to have misreplicated status once under/overreplicated status checks done?
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/RatisContainerHealthCheck.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.hadoop.hdds.scm.container.replication;
+
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
+import org.apache.hadoop.hdds.scm.ContainerPlacementStatus;
+import org.apache.hadoop.hdds.scm.PlacementPolicy;
+import org.apache.hadoop.hdds.scm.container.ContainerInfo;
+import org.apache.hadoop.hdds.scm.container.ContainerReplica;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * Class to determine the health state of a Ratis Container. Given the container
+ * and current replica details, along with replicas pending add and delete,
+ * this class will return a ContainerHealthResult indicating if the container
+ * is healthy, or under / over replicated etc.
+ */
+public class RatisContainerHealthCheck implements ContainerHealthCheck {
+ public static final Logger LOG =
+ LoggerFactory.getLogger(RatisContainerHealthCheck.class);
+
+ /**
+ * PlacementPolicy which is used to identify where a container
+ * should be replicated.
+ */
+ private final PlacementPolicy ratisContainerPlacement;
+
+ public RatisContainerHealthCheck(final PlacementPolicy containerPlacement) {
+ this.ratisContainerPlacement = containerPlacement;
+ }
+
+ @Override
+ public ContainerHealthResult checkHealth(ContainerInfo container,
+ Set<ContainerReplica> replicas,
+ List<ContainerReplicaOp> replicaPendingOps,
+ int remainingRedundancyForMaintenance) {
+ int pendingAdd = 0;
+ int pendingDelete = 0;
+ for (ContainerReplicaOp op : replicaPendingOps) {
+ if (op.getOpType() == ContainerReplicaOp.PendingOpType.ADD) {
+ pendingAdd++;
+ } else if (op.getOpType() == ContainerReplicaOp.PendingOpType.DELETE) {
+ pendingDelete++;
+ } else {
+ LOG.warn("unknown opType of op : {}", op);
+ //TODO: return an appropriate state
+ return new ContainerHealthResult.UnHealthyResult(container);
+ }
+ }
+ int requiredNodes = container.getReplicationConfig().getRequiredNodes();
+
+ RatisContainerReplicaCount replicaCount =
+ new RatisContainerReplicaCount(container, replicas, pendingAdd,
+ pendingDelete, requiredNodes, remainingRedundancyForMaintenance);
+
+ ContainerPlacementStatus placementStatus =
+ getPlacementStatus(replicas, requiredNodes);
+
+ boolean sufficientlyReplicated = replicaCount.isSufficientlyReplicated();
+ boolean isPolicySatisfied = placementStatus.isPolicySatisfied();
+ if (!sufficientlyReplicated || !isPolicySatisfied) {
Review Comment:
Even if HDDS-6892 implemented to provide Mis replicated status, we need to revisit here to use that. So, I would suggest to file a followup.
--
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 #3634: HDDS-7058. EC: ReplicationManager - Implement Ratis Container healthCheck
Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on PR #3634:
URL: https://github.com/apache/ozone/pull/3634#issuecomment-1273040031
@sodonnel I will be back soon, thanks for working on this. please feel free to take this jira and i will close this one!
--
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