You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafodion.apache.org by "Lijian (Q)" <ji...@huawei.com> on 2015/09/16 12:34:59 UTC

Question about commit conflict check

Hi, Hans, Narendra,

       I’m reading source code of trafodion’s DTM and get confused about commit conflict check.

       When a transaction want to commit, it need to check update conflict first. If there’s update row conflict with other running transactions that started before the commit time, the transaction will abort.
This work is done by TrxTransactionState.hasconflict, and all the running transactions get from the set transactionsToCheck in TrxTransactionState.java。

My question is how we can get all running transactions when transactions may be execute in different node? To my opinion, the transactionsToCheck just include the running transactions in one node, not all nodes.

For Example:
tx1 run on node1 and tx1 update a row in region1.
tx2 run on node2 and tx2 update the same row in region1.
tx1 commit first.
tx2 want  to commit, and he check row conflict and get running transactions from set transactionsToCheck, but tx1 is not in the set transactionsToCheck in node1’s TM, It’s in the set transactionsToCheck in node2’s TM. How can tx2 get the row conflict?


Thanks.