Divneet18 commented on code in PR #1686:
URL: https://github.com/apache/phoenix/pull/1686#discussion_r1336404898


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -707,7 +707,8 @@ public void clearTableRegionCache(TableName tableName) 
throws SQLException {
     public byte[] getNextRegionStartKey(HRegionLocation regionLocation, byte[] 
currentKey) throws IOException {
         // in order to check the overlap/inconsistencies bad region info, we 
have to make sure
         // the current endKey always increasing(compare the previous endKey)
-        if (Bytes.compareTo(regionLocation.getRegion().getEndKey(), 
currentKey) <= 0
+        if ((Bytes.compareTo(regionLocation.getRegion().getStartKey(), 
currentKey) != 0

Review Comment:
   Whenever the start key of new region is not same as the end key of the 
previous region it will cause an overlap or a hole. Thats why when the 
compareTo condition is !=0 we want to throw an error. 
   
   the currentKey is the previous regions endKey being used in the 
getAllTableRegions method. Its being called currentKey because of how 
getAllTableRegions iterates over the list and compares but to avoid further 
confusion I have added a comment in the code mentioning currentKey=previous 
regions endKey



-- 
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]

Reply via email to