Professional Documents
Culture Documents
Transaction Management Overview: Transaction Management and Recovery, 2 Edition. R. Ramakrishnan and J. Gehrke 1
Transaction Management Overview: Transaction Management and Recovery, 2 Edition. R. Ramakrishnan and J. Gehrke 1
Chapter 18
Buffer Manager
LOCK TABLE
Storage Manager
BUFFERS BUFFER POOL
Chapter 19
A
T1 T2 Dependency graph
B
The cycle in the graph reveals the problem.
The output of T1 depends on T2, and vice-
versa.
Transaction Management and Recovery, 2nd Edition. R. Ramakrishnan and J. Gehrke 22
Dependency Graph
Transaction Table:
One entry per active Xact.
Contains XID, status (running/commited/aborted),
and lastLSN.
Dirty Page Table:
One entry per dirty page in buffer pool.
Contains recLSN -- the LSN of the log record which
first caused the page to be dirty.
LOG RAM
DB
LogRecords
prevLSN Xact Table
XID Data pages lastLSN
type each status
pageID with a
length pageLSN Dirty Page Table
offset recLSN
before-image master record
after-image flushedLSN
RAM 00 begin_checkpoint
05 end_checkpoint
Xact Table 10 update: T1 writes P5 prevLSNs
lastLSN 20 update T2 writes P3
status
30 T1 abort
Dirty Page Table
recLSN 40 CLR: Undo T1 LSN 10
flushedLSN 45 T1 End
50 update: T3 writes P1
ToUndo 60 update: T2 writes P5
CRASH, RESTART