You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Samarth Jain (JIRA)" <ji...@apache.org> on 2016/04/07 23:51:25 UTC

[jira] [Created] (PHOENIX-2824) PhoenixTransactionalIndexer rollback doesn't work correctly

Samarth Jain created PHOENIX-2824:
-------------------------------------

             Summary: PhoenixTransactionalIndexer rollback doesn't work correctly
                 Key: PHOENIX-2824
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2824
             Project: Phoenix
          Issue Type: Bug
            Reporter: Samarth Jain
            Assignee: James Taylor


Looking at this piece of code in PhoenixTransactionalIndexer in processRollback(), something isn't right:

{code}
do {
                        Cell cell = cells.get(i);
                        hasPuts |= cell.getTypeByte() == KeyValue.Type.Put.getCode();
                        writePtr = cell.getTimestamp();
                        do {
                            // Add at the beginning of the list to match the expected HBase
                            // newest to oldest sort order (which TxTableState relies on
                            // with the Result.getLatestColumnValue() calls).
                            singleTimeCells.addFirst(cell);
                        } while (++i < nCells && cells.get(i).getTimestamp() == writePtr);
                    } while (i < nCells && cells.get(i).getTimestamp() <= readPtr);

{code}

The cell variable isn't being reset in the inner loop even though index i has been incremented. As a result we always end up adding cells.get(0) to singleTimeCells list. However, simply doing this:

{code} 
while (++i < nCells && (cell = cells.get(i)).getTimestamp() == writePtr)
{code}

unfortunately doesn't work. I see test failures in MutableRollbackIT after the above change.






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