sodonnel commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2932469117
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/QuasiClosedStuckReplicationCheck.java:
##########
@@ -28,26 +28,37 @@
import org.apache.hadoop.hdds.scm.container.replication.ContainerHealthResult;
import org.apache.hadoop.hdds.scm.container.replication.ContainerReplicaOp;
import
org.apache.hadoop.hdds.scm.container.replication.QuasiClosedStuckReplicaCount;
+import org.apache.hadoop.hdds.scm.container.replication.ReplicationManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Class to check for the replication of the replicas in quasi-closed stuck
containers. As we want to maintain
- * as much data and information as possible, the rule for QC stuck container
is to maintain 2 copies of each origin
- * if there is more than 1 origin. If there is only 1 origin, then we need to
maintain 3 copies.
+ * as much data and information as possible, the rule for QC stuck container
is to maintain a configurable number
+ * of copies of the origin with the highest BCSID (bestOriginCopies, default
3), and a configurable number of copies
+ * of each other origin (otherOriginCopies, default 2). If there is only 1
origin, bestOriginCopies copies are kept.
*/
public class QuasiClosedStuckReplicationCheck extends AbstractCheck {
private static final Logger LOG =
LoggerFactory.getLogger(QuasiClosedStuckReplicationCheck.class);
+ private final ReplicationManager.ReplicationManagerConfiguration rmConf;
+
+ public
QuasiClosedStuckReplicationCheck(ReplicationManager.ReplicationManagerConfiguration
rmConf) {
+ this.rmConf = rmConf;
+ }
+
public static boolean shouldHandleAsQuasiClosedStuck(ContainerInfo
containerInfo, Set<ContainerReplica> replicas) {
if (containerInfo.getState() != QUASI_CLOSED) {
return false;
}
if (!QuasiClosedContainerHandler.isQuasiClosedStuck(containerInfo,
replicas)) {
return false;
}
- QuasiClosedStuckReplicaCount replicaCount = new
QuasiClosedStuckReplicaCount(replicas, 0);
- if (replicaCount.availableOrigins() == 1) {
+ long distinctOrigins = replicas.stream()
Review Comment:
Is this change needed? Why does `(replicaCount.availableOrigins() == 1)` not
work anymore? It should be the same thing I think.
--
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]