JEPSEN

G-single (Single Anti-dependency Cycle)

Phenomenon G-single (Single Anti-dependency Cycle) is a specific kind of G2: a cycle containing exactly one read-write dependency between transactions. Intuitively, G-single describes a situation in which a single transaction observes (possibly indirectly, through a chain of writes and reads) another transaction, but also misses some effect of that same transaction. Specifically, G-single is a dependency cycle made up of any number of write-write and write-read edges, and at least one read-write edge—also known as an anti-dependency. G-single is legal under Read Committed, but proscribed by PL-2+, Snapshot Isolation and stronger models.

For example, imagine a history of two transactions over integer registers. Transaction Ti inserts x = 1 and y = 1. Transaction Tj reads x = 1, and reads the unborn state of y. Tj write-read depends on Ti because it observed Ti’s write of x. However, Ti read-write depends on Tj because Tj observed the unborn version of y just prior to Ti’s write. Tj observed some, but not all, of Ti’s effects.

Formally

G-single is defined in Adya’s thesis, section 4.1.1, in terms of a Direct Serialization Graph, or DSG:

G-single: Single Anti-dependency Cycles. A history H exhibits phenomenon G-single if DSG(H) contains a directed cycle with exactly one anti-dependency edge.

See Also

G-nonadjacent is a more general cycle in which no two read-write dependency edges appear next to each other. Ruling out G-nonadjacent strengthens PL-2+ to Snapshot Isolation.

Even more general, G2 is a cycle with any number and arrangement of read-write dependencies. Ruling out G2 strengthens PL-2+ to Serializable.