Concurrency Control via Locking




CS157b

Chris Pollett

Apr 13, 2020

Outline

Locking

More on Locking

Two Phase Locking (2PL)

Why two-phase locking works

Quiz

Which of the following statements is true?

  1. In redo logging, we flush all changed DB elements before we write a commit.
  2. In undo-redo logging, to do a non-quiescent checkpoint, we write a start checkpoint, then write all dirty buffer to disk, then write an end check point, and finally flush the log file.
  3. All serializable schedules are conflict serializable.

Different types of Lock Modes

Compatibility Matrix

Upgrading Locks

Update Locks

Update Lock Compatibility Matrix

Increment Locks

Compatibility Matrix for Increment Locks

Lock Scheduler Architecture

A Two Part Scheduler