You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@omid.apache.org by ohadshacham <gi...@git.apache.org> on 2018/02/01 08:15:54 UTC

[GitHub] incubator-omid pull request #19: [OMID-84] Today, all the writes done by a t...

GitHub user ohadshacham opened a pull request:

    https://github.com/apache/incubator-omid/pull/19

    [OMID-84] Today, all the writes done by a transaction are taking part…

    … in conflict analysis. The purpose of this feature is to let the user decide for each write, whether it should take part in the conflict analysis.
    
    The motivation infers from Apache Phoenix that utilizes this feature when writing to the secondary index and also when writing to the data table for immutable tables (each key is added once and is not modified).

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

    $ git pull https://github.com/ohadshacham/incubator-omid OMID-84-from-master

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

    https://github.com/apache/incubator-omid/pull/19.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 #19
    
----
commit 8fad7b57e3bb6ce6b69e753252c43c33af5a8eeb
Author: Ohad Shacham <oh...@...>
Date:   2018-01-31T14:52:43Z

    [OMID-84] Today, all the writes done by a transaction are taking part in conflict analysis. The purpose of this feature is to let the user decide for each write, whether it should take part in the conflict analysis.
    The motivation infers from Apache Phoenix that utilizes this feature when writing to the secondary index and also when writing to the data table for immutable tables (each key is added once and is not modified).

----


---

[GitHub] incubator-omid pull request #19: [OMID-84] Today, all the writes done by a t...

Posted by ebortnikov <gi...@git.apache.org>.
Github user ebortnikov commented on a diff in the pull request:

    https://github.com/apache/incubator-omid/pull/19#discussion_r166405171
  
    --- Diff: hbase-client/src/main/java/org/apache/omid/transaction/HBaseTransaction.java ---
    @@ -31,25 +31,31 @@
     public class HBaseTransaction extends AbstractTransaction<HBaseCellId> {
         private static final Logger LOG = LoggerFactory.getLogger(HBaseTransaction.class);
     
    -    public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) {
    -        super(transactionId, epoch, writeSet, tm);
    +    public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) {
    +        super(transactionId, epoch, writeSet, conflictFreeWriteSet, tm);
         }
     
    -    public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) {
    -        super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, tm);
    +    public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) {
    +        super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, conflictFreeWriteSet, tm);
         }
     
    +    private void cleanCell(HBaseCellId cell) {
    +        Delete delete = new Delete(cell.getRow());
    +        delete.deleteColumn(cell.getFamily(), cell.getQualifier(), cell.getTimestamp());
    +        try {
    +            cell.getTable().delete(delete);
    +        } catch (IOException e) {
    +            LOG.warn("Failed cleanup cell {} for Tx {}. This issue has been ignored", cell, getTransactionId(), e);
    +        }
    +    }
         @Override
         public void cleanup() {
    -        Set<HBaseCellId> writeSet = getWriteSet();
    -        for (final HBaseCellId cell : writeSet) {
    -            Delete delete = new Delete(cell.getRow());
    -            delete.deleteColumn(cell.getFamily(), cell.getQualifier(), cell.getTimestamp());
    -            try {
    -                cell.getTable().delete(delete);
    -            } catch (IOException e) {
    -                LOG.warn("Failed cleanup cell {} for Tx {}. This issue has been ignored", cell, getTransactionId(), e);
    -            }
    +        for (final HBaseCellId cell : getWriteSet()) {
    +            cleanCell(cell);
    +        }
    +
    +        for (final HBaseCellId cell : getConflictFreeWriteSet()) {
    --- End diff --
    
    Are conflict free writes applicable to Delete? 


---

[GitHub] incubator-omid pull request #19: [OMID-84] Today, all the writes done by a t...

Posted by ohadshacham <gi...@git.apache.org>.
Github user ohadshacham commented on a diff in the pull request:

    https://github.com/apache/incubator-omid/pull/19#discussion_r166572983
  
    --- Diff: hbase-client/src/main/java/org/apache/omid/transaction/HBaseTransaction.java ---
    @@ -31,25 +31,31 @@
     public class HBaseTransaction extends AbstractTransaction<HBaseCellId> {
         private static final Logger LOG = LoggerFactory.getLogger(HBaseTransaction.class);
     
    -    public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) {
    -        super(transactionId, epoch, writeSet, tm);
    +    public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) {
    +        super(transactionId, epoch, writeSet, conflictFreeWriteSet, tm);
         }
     
    -    public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) {
    -        super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, tm);
    +    public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) {
    +        super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, conflictFreeWriteSet, tm);
         }
     
    +    private void cleanCell(HBaseCellId cell) {
    +        Delete delete = new Delete(cell.getRow());
    +        delete.deleteColumn(cell.getFamily(), cell.getQualifier(), cell.getTimestamp());
    +        try {
    +            cell.getTable().delete(delete);
    +        } catch (IOException e) {
    +            LOG.warn("Failed cleanup cell {} for Tx {}. This issue has been ignored", cell, getTransactionId(), e);
    +        }
    +    }
         @Override
         public void cleanup() {
    -        Set<HBaseCellId> writeSet = getWriteSet();
    -        for (final HBaseCellId cell : writeSet) {
    -            Delete delete = new Delete(cell.getRow());
    -            delete.deleteColumn(cell.getFamily(), cell.getQualifier(), cell.getTimestamp());
    -            try {
    -                cell.getTable().delete(delete);
    -            } catch (IOException e) {
    -                LOG.warn("Failed cleanup cell {} for Tx {}. This issue has been ignored", cell, getTransactionId(), e);
    -            }
    +        for (final HBaseCellId cell : getWriteSet()) {
    +            cleanCell(cell);
    +        }
    +
    +        for (final HBaseCellId cell : getConflictFreeWriteSet()) {
    --- End diff --
    
    Yes, deleting is actually adding a tombstone and after a rollback these tombstones should be discarded. Naturally, these mutation are candidates for conflict analysis unless someone asks differently. 


---

[GitHub] incubator-omid pull request #19: [OMID-84] Today, all the writes done by a t...

Posted by ohadshacham <gi...@git.apache.org>.
Github user ohadshacham closed the pull request at:

    https://github.com/apache/incubator-omid/pull/19


---

[GitHub] incubator-omid pull request #19: [OMID-84] Today, all the writes done by a t...

Posted by ebortnikov <gi...@git.apache.org>.
Github user ebortnikov commented on a diff in the pull request:

    https://github.com/apache/incubator-omid/pull/19#discussion_r166405079
  
    --- Diff: hbase-client/src/main/java/org/apache/omid/transaction/HBaseTransaction.java ---
    @@ -31,25 +31,31 @@
     public class HBaseTransaction extends AbstractTransaction<HBaseCellId> {
         private static final Logger LOG = LoggerFactory.getLogger(HBaseTransaction.class);
     
    -    public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) {
    -        super(transactionId, epoch, writeSet, tm);
    +    public HBaseTransaction(long transactionId, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) {
    +        super(transactionId, epoch, writeSet, conflictFreeWriteSet, tm);
         }
     
    -    public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, AbstractTransactionManager tm) {
    -        super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, tm);
    +    public HBaseTransaction(long transactionId, long readTimestamp, VisibilityLevel visibilityLevel, long epoch, Set<HBaseCellId> writeSet, Set<HBaseCellId> conflictFreeWriteSet, AbstractTransactionManager tm) {
    +        super(transactionId, readTimestamp, visibilityLevel, epoch, writeSet, conflictFreeWriteSet, tm);
         }
     
    +    private void cleanCell(HBaseCellId cell) {
    --- End diff --
    
    cleanCell --> deleteCell? 


---