Executing the Request

During the lifetime of a request, the request can finally be executed after the concurrency manager calls sequence_req. In this section, we finally get to look at how the requests are executed.

These are the request types of the database:

  • BeginTxn
  • CommitTxn
  • AbortTxn
  • Get
  • Put

Each command needs to implement an execute method. Here are its implementations:

BeginTxn

CommitTxn

AbortTxn

Get

Put

  • Put uses mvcc_put to attempt to put an uncommitted intent into the database.
  • If mvcc_put is successful, it adds the uncommitted intent to the lock table by calling acquire_lock
  • Otherwise, this means that an uncommitted intent was detected. Since there can only be one uncommitted intent for each key, the function returns a WriteIntentError