You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Sandhya Sundaresan (JIRA)" <ji...@apache.org> on 2018/06/15 20:31:00 UTC

[jira] [Commented] (TRAFODION-3092) Incorrect rowcount reported after commit conflict error

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

Sandhya Sundaresan commented on TRAFODION-3092:
-----------------------------------------------

The fix is to capture the diags area after ContexCli::closeAllCursors . This method internally closes Statements and commits a transaction. Any  commit conflicts were not being captured and returned to the calling layer - Statement::commitTransaction. And then at the calling layer since we have already set the rowsAffected count before calling Commit transaction, we need to rest the count to 0  if there was a commit conflict.

 

> Incorrect rowcount reported after commit conflict error
> -------------------------------------------------------
>
>                 Key: TRAFODION-3092
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3092
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>            Reporter: Sandhya Sundaresan
>            Assignee: Sandhya Sundaresan
>            Priority: Major
>
> When there are 2 sessions doing concurrent SQL IUD operations like update or insert, a commit conflict can occur. When this error occurs, the rowcount reposrted by the SQL diagnostics is incorrect. Even though 0 rows got inserted, it reports 2 rows. Same for updates. 
>  
> >>insert into tl values (5,5),(6,6);
> ..
> Breakpoint 3, BEGINTX (pp_tag=0x7ffff7e75c58, pv_timeout=-1, pv_type_flags=1)
>  at tmlib.cpp:923
> 923 TM_Transaction *lp_trans = NULL;
> (gdb) c
> Continuing.
> Breakpoint 5, ExTransaction::commitTransaction (this=0x7ffff7e75b80, waited=0)
>  at ../executor/ex_transaction.cpp:645
> 645 dp2Xns_ = FALSE;
> (gdb) c
> Continuing.
> Breakpoint 6, ComDiagsArea::insertNewError (this=0x7ffff7e98048)
>  at ../export/ComDiags.cpp:2756
> 2756 errors_.insert(newCondition_);
> (gdb) c
> Continuing.
> Breakpoint 6, ComDiagsArea::insertNewError (this=0x7ffff7ef4408)
>  at ../export/ComDiags.cpp:2756
> 2756 errors_.insert(newCondition_);
> (gdb) c
> Continuing.
> *** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 257 regionTX: false status: PENDING neverReadOnly: false scan Size: 4 write Size: 2 startSQ: 9 prepareEditSize: 0 endEditSize: 0 editSize: 2]] has a scan, scanRange[startRow: \x80\x00\x00\x05, endRow: \x80\x00\x00\x05] that conflicts with a committed Transaction [[transactionId: 258 regionTX: false status: COMMITED neverReadOnly: false scan Size: 4 write Size: 2 startSQ: 9 prepareEditSize: 2 endEditSize: 1 editSize: 2 commitedSQ:9]] which , inserted a row with key[\x80\x00\x00\x05], in the region [TRAFODION.SEABASE.TL,,1527701720547.2d9b1459c2f326be937f14e414cc68ad.]
> org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525)
> --- 2 row(s) inserted.
> >>



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)