[ 
https://issues.apache.org/jira/browse/PHOENIX-6437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338705#comment-17338705
 ] 

ASF GitHub Bot commented on PHOENIX-6437:
-----------------------------------------

ankitjain64 commented on a change in pull request #1219:
URL: https://github.com/apache/phoenix/pull/1219#discussion_r625451166



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/replication/SystemCatalogWALEntryFilter.java
##########
@@ -103,18 +104,20 @@ private boolean isTenantRowCellSystemChildLink(final Cell 
cell) {
     if (!isTenantRowCell) {
       boolean isChildLink = CellUtil.matchingQualifier(
         cell, PhoenixDatabaseMetaData.LINK_TYPE_BYTES);
-      if (isChildLink) {
-        if (CellUtil.matchingValue(cell, CHILD_TABLE_BYTES)) {
+      // Check if cell is of type LINK_TYPE with value 4 or DeleteFamily
+      if ((isChildLink && CellUtil.matchingValue(cell, CHILD_TABLE_BYTES)) ||
+          CellUtil.isDeleteFamily(cell) ) {

Review comment:
       To replicate a delete marker we are using two checks.
   1. The cell is of type `DeleteFamily`.
   2. The length for `COLUMN_NAME` is greater than `0`. (For tenant views 
column_name is populated with tenant_id which is not the case for global views.)
   
   One may argue that the above two checks are also true for delete markers of 
column rows and we may over-replicate those rows. But, we are avoiding all 
those scenarios by doing the above filtering only for the mutations belonging 
to `SYSTEM.CHILD_LINK` table. With 4.15+ we are assured that 
`SYSTEM.CHILD_LINK` table only stores parent-child linking rows with 
`LINK_TYPE=4`, so the only thing we need to differentiate here is parent-child 
link delete markers for tenant vs non-tenant view. Let me know if you still 
feel we are missing any scenario. Thanks




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


> Delete marker for parent-child rows does not get replicated via 
> SystemCatalogWALEntryFilter
> -------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6437
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6437
>             Project: Phoenix
>          Issue Type: Bug
>          Components: core
>            Reporter: Ankit Jain
>            Assignee: Ankit Jain
>            Priority: Major
>
> As part of PHOENIX-3639  SystemCatalogWALEntryFilter was introduced to 
> replicate tenant owned rows from system.catalog and ignore the non-tenant 
> rows. During recent testing it was realized that delete markers for 
> parent-child rows does not get replicated. As part of this Jira we want to 
> fix that.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to