Transaction related queries for conflicting transactions ( Coming from a Mysql Innodb Transaction mgmt environment)

I am referring to the Dgraph paper while answering these questions.

  1. While your observation can be generally true, there is a fine difference that might need attention. As per the paper:
    "When a transaction requests a
    commit, Zero would check if any of those keys has a commit
    timestamp higher than the start timestamp of the transaction.
    If the condition is met, the transaction is aborted. "

Apart from the Start ts, there is a commit ts in play. So it can potentially mean that when A and B update a key simultaneously, the first one to commit will succeed. In other words, the start Ts alone does not guarantee ordering.

  1. Dgraph will throw a “TxnConflictException”, a conflict exception, as soon as it detects one.

  2. Dgraph reads are linearizable, so yes.

1 Like