A transaction is a set of operations that should happen atomically. Exactly which operations that may include is up for discussion, but think reads, writes, deletes, and possibly index lookups for now.

Contents:

Client-Side Transactions

Assuming initially object ID 1 contains A, 2 contains B, 3 contains C.

  1. Client writes placeholder T with object IDs (1, 2, 3)
  2. Client adds masks to objects 1, 2, 3 which all point to T
  3. Client updates T with (write A' at 1 over version V1, write B' at 2 over version V2, write C' at 3 over version V3)
  4. Client writes A' into 1, B' into 2, C' into 3
  5. Client deletes T

Consequences

Server-Side Transactions (2PC)

  1. Client sends MT ("minitransaction") to master
  2. Master writes transaction object with list of participants, acquiring a txid
  3. Master sends txid, MT to all participants
  4. Participants lock objects and log MT
  5. Participants send vote to master
  6. If the decision is yes, the master notes it in the transaction object
  7. Master relays decision to participants
  8. Master sends response to client
  9. If the decision is yes, the participants commit. Otherwise, they unlock/roll back.
  10. Participants sends commit acknowledgement to master
  11. Master removes transaction object

Failure Scenarios