Multiple Granularity Locking - Lock Modes

Lock Modes

In addition to shared (S) locks and exclusive (X) locks from other locking schemes, like strict two-phase locking, MGL also uses intention shared and intention exclusive locks. IS locks conflict with X locks, while IX locks conflict with S and X locks. The null lock (NL) is compatible with everything.

To lock a node in S (or X), MGL has the transaction lock all of its ancestors with IS (or IX), so if a transaction locks a node in S (or X), no other transaction can access its ancestors in X (or S and X).

Determining what level of granularity to use for locking is done by locking the finest level possible (at the lowest leaf level), and then escalating these locks to higher levels in the file hierarchy to cover more records or file elements as needed. This process is known as Lock Escalation. MGL locking modes are compatible with each other as defined in the following matrix.

Mode NL IS IX S SIX X
NL Yes Yes Yes Yes Yes Yes
IS Yes Yes Yes Yes Yes No
IX Yes Yes Yes No No No
S Yes Yes No Yes No No
SIX Yes Yes No No No No
X Yes No No No No No

Read more about this topic:  Multiple Granularity Locking

Famous quotes containing the words lock and/or modes:

    There warn’t anybody at the church, except maybe a hog or two, for there warn’t any lock on the door, and hogs likes a puncheon floor in summertime because it’s cool. If you notice, most folks don’t go to church only when they’ve got to; but a hog is different.
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)

    Men and women are brothers and sisters; they are not of different species; and what need be obtained to know both, but to allow for different modes of education, for situation and constitution, or perhaps I should rather say, for habits, whether good or bad.
    Samuel Richardson (1689–1761)