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

Create/Replicate Open, Commit (without writes) and Abort Txn events

    XMLWordPrintableJSON

Details

    Description

      EVENT_OPEN_TXN:
      Source Warehouse:

      • Create new event type EVENT_OPEN_TXN with related message format etc.
      • When any transaction is opened either by auto-commit mode or multi-statement mode, need to capture this event.
      • Repl dump should read this event from EventNotificationTable and dump the message.

      Target Warehouse:

      • Repl load should read the event from the dump and get the message.
      • Open a txn in target warehouse.
      • Create a map of source txn ID against target txn ID and persist the same in metastore. There should be one map per replication policy (DBName.* incase of DB level replication, DBName.TableName incase of table level replication)

       

      EVENT_COMMIT_TXN (Without writes)

      Add new EVENT_COMMIT_TXN to log the metadata/data of all tables/partitions modified within the txn.

      Source warehouse:

      • Create EVENT_COMMIT_TXN event type with corresponding message format etc.

      Target warehouse:

      • Repl load should read this event from the dump.
      • Validate the source txn ID from the event using the Source-Target Txn ID map maintained in target metastore. Also, need to check if corresponding target txn ID is valid.
      • If valid, then apply the event and commit the corresponding target transaction.
      • This new event should be idempotent such that if it is applied twice, then second time it should be loop.

       

      EVENT_ABORT_TXN
      Source Warehouse:

      • Create new event type EVENT_ABORT_TXN with related message format etc.
      • Capture this event when abort the txn.
      • Repl dump should read this event from EventNotificationTable and dump the message.

      Target Warehouse:

      • Repl load should read the event from the dump and get the message.
      • Validate if source txn ID from the event is there in the source-target txn ID map. If not there, just noop the event.
      • If valid, then Abort the corresponding target txn and remove the entry from source-target txn ID map.

      All these new events should be idempotent such that if it is applied twice, then second time it should be noop.

      Attachments

        1. HIVE-18781.01.patch
          1.19 MB
          mahesh kumar behera
        2. HIVE-18781.02.patch
          1.19 MB
          mahesh kumar behera
        3. HIVE-18781.03.patch
          1.20 MB
          mahesh kumar behera
        4. HIVE-18781.04.patch
          1.22 MB
          mahesh kumar behera
        5. HIVE-18781.05.patch
          1.35 MB
          mahesh kumar behera
        6. HIVE-18781.06.patch
          1.35 MB
          mahesh kumar behera
        7. HIVE-18781.07.patch
          1.36 MB
          mahesh kumar behera
        8. HIVE-18781.08.patch
          1.23 MB
          mahesh kumar behera
        9. HIVE-18781.09.patch
          1.24 MB
          mahesh kumar behera
        10. HIVE-18781.10.patch
          1.24 MB
          mahesh kumar behera
        11. HIVE-18781.11.patch
          1.24 MB
          mahesh kumar behera
        12. HIVE-18781.12.patch
          1.25 MB
          mahesh kumar behera

        Issue Links

          Activity

            People

              maheshk114 mahesh kumar behera
              maheshk114 mahesh kumar behera
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: