Apache9 commented on a change in pull request #2645:
URL: https://github.com/apache/hbase/pull/2645#discussion_r521767098
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java
##########
@@ -209,13 +209,13 @@ public MoreResults moreResultsForScan() {
LOG.debug("Scan with primary region returns " + e.getCause());
}
- // If rl's size is 1 or scan's consitency is strong, it needs to throw
- // out the exception from the primary replica
- if ((regionReplication == 1) || (scan.getConsistency() ==
Consistency.STRONG)) {
+ // If rl's size is 1 or scan's consistency is strong or a specific
replica id has been
+ // specified, it needs to throw out the exception from the first tried
replica
+ if (regionReplication == 1 || scan.getConsistency() ==
Consistency.STRONG ||
+ scan.getReplicaId() >= 0) {
Review comment:
The logic is strange. If scan is strong we set endIndex to 1, and
startIndex is also, so when calling cs.pollForFirstSuccessfullyCompletedTask we
will get a null and then we will throw the exception out. But in
pollForFirstSuccessfullyCompletedTask, we have this
```
// impossible to reach
return null;
```
Which is really confusing...
Anyway, we all know that after years of patching on the sync client, the
code is totally a mess so I will follow your approach to make the code safer...
It is good that we do not need to maintain the code on master...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]