tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TEPHRA-208) Compaction removes rows incorrectly for family deletes with column level conflict detection
Date Tue, 10 Jan 2017 02:23:58 GMT

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

ASF GitHub Bot commented on TEPHRA-208:
---------------------------------------

GitHub user twdsilva opened a pull request:

    https://github.com/apache/incubator-tephra/pull/26

    TEPHRA-208 Compaction removes rows incorrectly for family deletes wit…

    …h column level conflict detection
    
    @poornachandra  @gokulavasan  


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/twdsilva/incubator-tephra TEPHRA-208

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tephra/pull/26.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #26
    
----
commit e6fd62d6d86c8fb9cf89b6f727c53f14dd215465
Author: Thomas D'Silva <tdsilva@salesforce.com>
Date:   2017-01-09T23:02:00Z

    TEPHRA-208 Compaction removes rows incorrectly for family deletes with column level conflict
detection

----


> Compaction removes rows incorrectly for family deletes with column level conflict detection

> --------------------------------------------------------------------------------------------
>
>                 Key: TEPHRA-208
>                 URL: https://issues.apache.org/jira/browse/TEPHRA-208
>             Project: Tephra
>          Issue Type: Bug
>    Affects Versions: 0.9.0-incubating
>            Reporter: Thomas D'Silva
>            Assignee: Poorna Chandra
>         Attachments: TEPHRA-208.patch
>
>
> In DeleteTracker we only check the timestamp while removing cells during compaction.
If the previous row had a family delete, cells from subsequent rows could also be compacted.

> The attached test fails without the following change
> {code}
> private static final class DeleteTracker {
>      private long familyDeleteTs;
> +    private byte[] rowKey;
>  
>      public static boolean isFamilyDelete(Cell cell) {
>        return !TxUtils.isPreExistingVersion(cell.getTimestamp()) &&
> @@ -300,14 +301,17 @@ public class TransactionVisibilityFilter extends FilterBase {
>  
>      public void addFamilyDelete(Cell delete) {
>        this.familyDeleteTs = delete.getTimestamp();
> +      this.rowKey = Bytes.copy(delete.getRowArray(), delete.getRowOffset(), delete.getRowLength());
>      }
>  
>      public boolean isDeleted(Cell cell) {
> -      return cell.getTimestamp() <= familyDeleteTs;
> +      return rowKey != null && Bytes.compareTo(cell.getRowArray(), cell.getRowOffset(),

> +        cell.getRowLength(), rowKey, 0, rowKey.length) == 0 && cell.getTimestamp()
<= familyDeleteTs;
>      }
>  
>      public void reset() {
>        this.familyDeleteTs = 0;
> +      this.rowKey = null;
>      }
>    }
>  }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message