adoroszlai commented on code in PR #12089:
URL: https://github.com/apache/ozone/pull/12089#discussion_r4624645250
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientManager.java:
##########
@@ -260,14 +261,20 @@ protected XceiverClientSpi getClient(Pipeline pipeline,
boolean topologyAware, b
}
}
+ private static boolean isECReplica(Pipeline pipeline) {
+ return pipeline.getReplicaIndexes().values().stream().anyMatch(index ->
index > 0);
Review Comment:
Should it also check first if pipeline type is `STAND_ALONE`?
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientManager.java:
##########
@@ -260,14 +261,20 @@ protected XceiverClientSpi getClient(Pipeline pipeline,
boolean topologyAware, b
}
}
+ private static boolean isECReplica(Pipeline pipeline) {
+ return pipeline.getReplicaIndexes().values().stream().anyMatch(index ->
index > 0);
+ }
+
private String getPipelineCacheKey(Pipeline pipeline, boolean topologyAware,
boolean allowShortCircuit) {
StringBuilder key = new StringBuilder()
.append(pipeline.getId().getId()).append('-').append(pipeline.getType());
boolean isEC = pipeline.getType() == HddsProtos.ReplicationType.EC;
DatanodeDetails localDN = null;
boolean shortCircuitPipeline = false;
- if ((!isEC) && allowShortCircuit && isShortCircuitEnabled()) {
+ // Short-circuit reads are not supported for EC keys. EC key reads use a
single-node STAND_ALONE pipeline per
+ // replica, which is recognized by its non-zero replica index.
+ if (!isEC && !isECReplica(pipeline) && allowShortCircuit &&
isShortCircuitEnabled()) {
Review Comment:
Please check all cheap conditions before `isECReplica`.
--
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]