You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Sankar Hariappan (JIRA)" <ji...@apache.org> on 2018/03/07 10:29:00 UTC

[jira] [Comment Edited] (HIVE-18864) ValidWriteIdList snapshot seems incorrect if obtained after allocating writeId by current transaction.

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

Sankar Hariappan edited comment on HIVE-18864 at 3/7/18 10:28 AM:
------------------------------------------------------------------

Attached 02.patch with
 * Redundant code path removed.
 * Added unique index for t2w_writeid/table on TXN_TO_WRITE_ID table as we traverse through the writeIds < hwm.
 * Fixed check style issues

Test failures in previous build are irrelevant to this patch.


was (Author: sankarh):
Attached 02.patch with
 * Redundant code path removed.
 * Fixed check style issues

Test failures in previous build are irrelevant to this patch.

> ValidWriteIdList snapshot seems incorrect if obtained after allocating writeId by current transaction.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-18864
>                 URL: https://issues.apache.org/jira/browse/HIVE-18864
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Transactions
>    Affects Versions: 3.0.0
>            Reporter: Sankar Hariappan
>            Assignee: Sankar Hariappan
>            Priority: Major
>              Labels: ACID, pull-request-available
>             Fix For: 3.0.0
>
>         Attachments: HIVE-18864.01.patch, HIVE-18864.02.patch
>
>
> For multi-statement txns, it is possible that write on a table happens after a read. Let's see the below scenario.
>  # Committed txn=9 writes on table T1 with writeId=5.
>  # Open txn=10. ValidTxnList(open:null, txn_HWM=10),
>  # Read table T1 from txn=10. ValidWriteIdList(open:null, write_HWM=5).
>  # Open txn=11, writes on table T1 with writeid=6.
>  # Read table T1 from txn=10. ValidWriteIdList(open:null, write_HWM=5).
>  # Write table T1 from txn=10 with writeId=7.
>  # Read table T1 from txn=10. {color:#d04437}*ValidWriteIdList(open:null, write_HWM=7)*. – This read will able to see rows added by txn=11 which is still open.{color}
> {color:#d04437}So, it is needed to rebuild the open/aborted list of ValidWriteIdList based on txn_HWM. Any writeId allocated by txnId > txn_HWM should be marked as open. In this example, *ValidWriteIdList(open:6, write_HWM=7)* should be generated.{color}
> {color:#333333}cc{color} [~ekoifman], [~thejas]



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