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:

    and wife or husband
    who does not lock the door of the marriage
    against you, finds you
    not as unwelcome third in the room, but as
    the light of the moon on flesh and hair.
    Denise Levertov (b. 1923)

    I cannot beat off
    Invincible modes of the sea, hearing:
    Be a man my son by God.
    He turned again
    To the purring jet yellowing the murder story,
    Deaf to the pathos circling in the air.
    Allen Tate (1899–1979)