Versions Compared

Key

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

...

Transactional Protocol Changes

Commit Protocol Changes

...

Commit

 

  1. Wen a tx is started a new version is assighned and MVCC coordinator adds a local  TxLog record with XID and ACTIVE flag
  2. the first change request to a datanode within the transaction produces a local TxLog record with XID and ACTIVE flag at the data node.
  3. at the commit stage each tx node adds a local TxLog record with XID and LOCALLY_COMMITTED flag

...

  1. and sends an acknowledge to TX coordinator
  2. TX coordinator sends to MVCC

...

  1. coordinator node a tx

...

  1. committed message.

...

  1. MVCC coordinator adds TxLog record with XID and COMMITTED flag, all the changes become visible.

...

  1. TX coordinator

...

  1. sends to participants a commit acknowledged message, nodes asyncronously mark tx as COMMITTED.

An error during commit

  1. Wen a tx is started a new version is assighned and MVCC coordinator adds a local  TxLog record with XID and ACTIVE flag
  2. the first change request to a datanode within the transaction produces a local TxLog record with XID and ACTIVE flag at the data node.
  3. at the commit stage each tx node adds a local TxLog record with XID and LOCALLY_COMMITTED flag and sends an acknowledge to TX coordinator 
  4. In case at least one participant does not confirm commit, TX coordinator sends to each participant rollback message
  5. each tx node adds a local TxLog record with XID and ABORTED flag and sends an acknowledge to TX coordinator, all the locks became released.
  6. TX coordinator sends to MVCC coordinator node a tx rolled back message.
  7. MVCC coordinator adds TxLog record with XID and ABORTED flag.

Rollback

  1. Wen a tx is started a new version is assighned and MVCC coordinator adds a local  TxLog record with XID and ACTIVE flag
  2. the first change request to a datanode within the transaction produces a local TxLog record with XID and ACTIVE flag at the data node.
  3. at the rollback stage each tx node adds a local TxLog record with XID and ABORTED flag and sends an acknowledge to TX coordinator
  4. TX coordinator sends to MVCC coordinator node a tx rolled back message.
  5. MVCC coordinator adds TxLog record with XID and ABORTED flag.

In case MVCC coordinator fails, newly assighned coordinator gets all TxLog subsets and checks that all LOCALLY_COMMITTED tx participants (at least one node from each primary to backup partition mapping) are alive and mark TX as COMMITTED (and sends to participants a commit acknowledged message, nodes asyncronously mark tx as COMMITTED) or LOCALLY_COMMITTED otherwise.

In case there is at least one node with tx in COMMITTED or ABORTED state the transaction marks marked as COMMITTED or ABORTED on MVCC coordinator and all tx nodes without tx node map check.

...