You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "aswinshakil (via GitHub)" <gi...@apache.org> on 2026/02/25 18:46:44 UTC
[PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
aswinshakil opened a new pull request, #9829:
URL: https://github.com/apache/ozone/pull/9829
## What changes were proposed in this pull request?
For diverged quasi-closed stuck containers, [HDDS-12483](https://issues.apache.org/jira/browse/HDDS-12483) keeps two copies of each origin. This change makes the replica counts configurable, so the origin with the highest BCSID can receive more copies than the others for better fault tolerance.The best origin is defined as the one with the highest BCSID among healthy replicas. If the highest BCSID replica is unhealthy, we fall back to the next highest healthy one. If multiple origins tie for the highest healthy BCSID, all of them are treated as best. Two new reconfigurable config keys are introduced:
- hdds.scm.replication.quasi.closed.stuck.best.origin.copies (default: 3)
- hdds.scm.replication.quasi.closed.stuck.other.origin.copies (default: 2)
With the defaults, the best origin gets 3 copies and all other origins get 2.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14714
## How was this patch tested?
Added and updated tests.
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on PR #9829:
URL: https://github.com/apache/ozone/pull/9829#issuecomment-4056505599
I think this looks generally OK, but please check my comments as I think there may be a few parts of the change we should revert.
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "aswinshakil (via GitHub)" <gi...@apache.org>.
aswinshakil commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2961574714
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/QuasiClosedStuckReplicaCount.java:
##########
@@ -106,28 +157,29 @@ public List<MisReplicatedOrigin> getUnderReplicatedReplicas() {
misReplicatedOrigins.add(new MisReplicatedOrigin(entry.getValue(), additionalReplicas));
}
} else {
- if (inService.size() < 3) {
- int additionalReplicas = 3 - inService.size();
+ if (inService.size() < bestOriginCopies) {
Review Comment:
By default it is 3, But what if we want to have more like 4 or 5? The main patch is trying to make this configurable. Maybe I can make the configuration to have minimum `bestOriginCopies` value as 3. If someone wants more copies they can have it. What do you 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: 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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
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: 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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "aswinshakil (via GitHub)" <gi...@apache.org>.
aswinshakil commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2962123107
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/QuasiClosedStuckReplicaCount.java:
##########
@@ -147,25 +199,24 @@ public boolean isOverReplicated() {
}
public List<MisReplicatedOrigin> getOverReplicatedOrigins() {
- // If there is only a single origin, we expect 3 copies, otherwise we expect 2 copies of each origin
+ // If there is only a single origin, we expect bestOriginCopies copies.
if (replicasByOrigin.size() == 1) {
final DatanodeID origin = replicasByOrigin.keySet().iterator().next();
final Set<ContainerReplica> inService = getInService(origin);
- if (inService.size() > 3) {
- return Collections.singletonList(new MisReplicatedOrigin(inService, inService.size() - 3));
+ if (inService.size() > bestOriginCopies) {
Review Comment:
Does this make sense here that we might not be using this code path? I can revert it to original behavior https://github.com/apache/ozone/pull/9829#discussion_r2962117132
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "aswinshakil (via GitHub)" <gi...@apache.org>.
aswinshakil commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2961583457
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/QuasiClosedStuckReplicaCount.java:
##########
@@ -147,25 +199,24 @@ public boolean isOverReplicated() {
}
public List<MisReplicatedOrigin> getOverReplicatedOrigins() {
- // If there is only a single origin, we expect 3 copies, otherwise we expect 2 copies of each origin
+ // If there is only a single origin, we expect bestOriginCopies copies.
if (replicasByOrigin.size() == 1) {
final DatanodeID origin = replicasByOrigin.keySet().iterator().next();
final Set<ContainerReplica> inService = getInService(origin);
- if (inService.size() > 3) {
- return Collections.singletonList(new MisReplicatedOrigin(inService, inService.size() - 3));
+ if (inService.size() > bestOriginCopies) {
Review Comment:
Wouldn't it be okay if `bestOriginCopies` minimum is 3? I can make the config lower bounded.
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2932426011
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/QuasiClosedStuckReplicaCount.java:
##########
@@ -106,28 +157,29 @@ public List<MisReplicatedOrigin> getUnderReplicatedReplicas() {
misReplicatedOrigins.add(new MisReplicatedOrigin(entry.getValue(), additionalReplicas));
}
} else {
- if (inService.size() < 3) {
- int additionalReplicas = 3 - inService.size();
+ if (inService.size() < bestOriginCopies) {
Review Comment:
Is this change correct? This is the case for only 1 origin available, so we always want to have 3 copies, even if the configuration is set to 2. I'm not sure we need to change the logic in this part.
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "aswinshakil (via GitHub)" <gi...@apache.org>.
aswinshakil merged PR #9829:
URL: https://github.com/apache/ozone/pull/9829
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2961651128
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/QuasiClosedStuckReplicaCount.java:
##########
@@ -106,28 +157,29 @@ public List<MisReplicatedOrigin> getUnderReplicatedReplicas() {
misReplicatedOrigins.add(new MisReplicatedOrigin(entry.getValue(), additionalReplicas));
}
} else {
- if (inService.size() < 3) {
- int additionalReplicas = 3 - inService.size();
+ if (inService.size() < bestOriginCopies) {
Review Comment:
Why would we want to have 4 of 5 copies of a replica with only a single origin? Why treat it different from a non-quasi closed container which can only have 3 copies? There isn't really any value in the single origin case of having more than 3, as the rest of the replicas on the cluster have only a redundancy of 3.
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "aswinshakil (via GitHub)" <gi...@apache.org>.
aswinshakil commented on PR #9829:
URL: https://github.com/apache/ozone/pull/9829#issuecomment-4120357420
Thanks for the review @sodonnel
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2932440873
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/QuasiClosedStuckReplicaCount.java:
##########
@@ -147,25 +199,24 @@ public boolean isOverReplicated() {
}
public List<MisReplicatedOrigin> getOverReplicatedOrigins() {
- // If there is only a single origin, we expect 3 copies, otherwise we expect 2 copies of each origin
+ // If there is only a single origin, we expect bestOriginCopies copies.
if (replicasByOrigin.size() == 1) {
final DatanodeID origin = replicasByOrigin.keySet().iterator().next();
final Set<ContainerReplica> inService = getInService(origin);
- if (inService.size() > 3) {
- return Collections.singletonList(new MisReplicatedOrigin(inService, inService.size() - 3));
+ if (inService.size() > bestOriginCopies) {
Review Comment:
Same comment as above. I am not sure we want to change this bit for the "one origin available" case.
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "aswinshakil (via GitHub)" <gi...@apache.org>.
aswinshakil commented on PR #9829:
URL: https://github.com/apache/ozone/pull/9829#issuecomment-4040943329
This needs verification for different container placement policy and satisfy the policy.
--
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
Re: [PR] HDDS-14714. Support keeping a configurable number of extra copies of quasi-closed containers. [ozone]
Posted by "aswinshakil (via GitHub)" <gi...@apache.org>.
aswinshakil commented on code in PR #9829:
URL: https://github.com/apache/ozone/pull/9829#discussion_r2962117132
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/QuasiClosedStuckReplicaCount.java:
##########
@@ -106,28 +157,29 @@ public List<MisReplicatedOrigin> getUnderReplicatedReplicas() {
misReplicatedOrigins.add(new MisReplicatedOrigin(entry.getValue(), additionalReplicas));
}
} else {
- if (inService.size() < 3) {
- int additionalReplicas = 3 - inService.size();
+ if (inService.size() < bestOriginCopies) {
Review Comment:
Okay we can keep it 3 itself. I can make the change. But looking at this code I'm wondering if this logic is even executed. Both `getOverReplicatedOrigins` and `getUnderReplicatedReplicas` are only called if the container is handled by either `QuasiClosedStuckOverReplicationHandler` or `QuasiClosedStuckUnderReplicationHandler`.
But if we look at `shouldHandleAsQuasiClosedStuck` it skips the container if we have only one originId. So replicas with only one originId are never handled by `QuasiClosedStuckOverReplicationHandler` or `QuasiClosedStuckUnderReplicationHandler`.
So this part of the code is it mostly like fail safe if the code is used somewhere in the future.
--
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