Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Each transaction consists of multiple operations in and tables, each sink operation commits data to table according Timestamp Barrier. The transaction will be committed after all the operations are committed.
  2. There is a sequential relationship between multiple transactions in processing data. They , they commit data to the same table serially.
  3. There're three states in a table for specific transaction : PreCommit, Commit and Snapshot
    1. PreCommit: Sink has committed data to table according to Timestamp Barrier , but the related transaction is processing and not committed. The committed data in the table may be rolled back if the job fails.
    2. Commit: The transaction related to a specific Timestamp Barrier is committed, and the data in tables may be rolled back if jobs fail.
    3. Snapshot: The transaction related to a specific Timestamp Barrier is committed and all the tables generate create snapshots for the transaction . The data in the tables won't be rolled back even when jobs fail.

...

User performs query SELECT userId, itemId, totalPrice, totalAmount, totalPrice / totalAmount as avgPrice FROM UserItemAmount a JOIN UserItemPrice p ON a.userId=p.userId and a.itemId=p.itemId on tables user_item_amount and user_item_price multiple times.

...

Read Uncommitted refers to querying table data of uncommitted transactions. When some tables in a transaction have committed data according to the Timestamp Barrier  and can be read by query, but the remaining tables have not been committed, and the transaction has will not been committed yet. For example

  1. The committed data in user_item_price are (user1, item1, 2500).
  2. The uncommitted data in user_item_amount are (user1, item1, 100).
  3. The result of user's query will be (user1, item1, 2500, 100, 25) which is not a consistency result.

...

Read Committed doesn't support Repeatable Read , which means when jobs fail after transaction T is committed, the data in tables will be rolled back and the query result will fallback from (user1, item1, 2500, 300, 8.33333) to (user1, item1, 1000, 100, 10)

...

Repeatable Read only reads data of a specific transaction from snapshot. The snapshots in a table won't be rolled back even when job failsjobs fail, and query can get a committed transaction from snapshots of tables. For example

...