palashc commented on code in PR #2057:
URL: https://github.com/apache/phoenix/pull/2057#discussion_r1926514487


##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/PhoenixMasterObserver.java:
##########
@@ -173,50 +219,113 @@ private List<String> getAncestorIds(Connection conn, 
String tableName, String st
                     Bytes.toStringBinary(regionInfoB.getStartKey()),
                     Bytes.toStringBinary(regionInfoB.getEndKey())));
         }
+        // if parent was a result of a merge, there will be multiple 
grandparents.
+        while (rs.next()) {
+            ancestorIDs.add(rs.getString(2));
+        }

Review Comment:
   @haridsv By ancestors here I mean both parent and grandparent. The parent in 
a split can be a result of a merge. For example: A and B merged to form C. We 
would have inserted 2 rows for the daughter C with 2 parents, (C-->A) and 
(C-->B), with the same start/end key. If C splits into D and E, we will insert 
(D-->C) and (E-->C). When we lookup the parent of D and E, we will find those 2 
rows with the same start/end key - both of which will need to be marked with 
the end time. (Parent's partition id is now part of the PK for CDC_STREAM 
table, so we will have to find all grandparents to mark the end time for a 
parent which has split). 
   
   Let me know if I am missing something here or over-complicating things. FYI 
@virajjasani 



-- 
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-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to