Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18320 Support ACID Tables Replication
  3. HIVE-18864

ValidWriteIdList snapshot seems incorrect if obtained after allocating writeId by current transaction.

    XMLWordPrintableJSON

Details

    Description

      For multi-statement txns, it is possible that write on a table happens after a read. Let's see the below scenario.

      1. Committed txn=9 writes on table T1 with writeId=5.
      2. Open txn=10. ValidTxnList(open:null, txn_HWM=10),
      3. Read table T1 from txn=10. ValidWriteIdList(open:null, write_HWM=5).
      4. Open txn=11, writes on table T1 with writeid=6.
      5. Read table T1 from txn=10. ValidWriteIdList(open:null, write_HWM=5).
      6. Write table T1 from txn=10 with writeId=7.
      7. Read table T1 from txn=10. ValidWriteIdList(open:null, write_HWM=7). – This read will able to see rows added by txn=11 which is still open.

      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.

      cc ekoifman, thejas

      Attachments

        1. HIVE-18864.02.patch
          20 kB
          Sankar Hariappan
        2. HIVE-18864.01.patch
          9 kB
          Sankar Hariappan

        Issue Links

          Activity

            People

              sankarh Sankar Hariappan
              sankarh Sankar Hariappan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: