Lec7 Logging
Lec7 Logging
Transactions
The main point of a log is to make complex operations atomic.
I.e. operations that involve many individual writes.
You want all writes or none, even if a crash in the middle.
Cite as: Robert Morris, course materials for 6.824 Distributed Computer Systems Engineering,
Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/), Massachusetts Institute of
Technology. Downloaded on [DD Month YYYY].
A "transaction" is a multi-write operation that should be atomic.
The logging system needs to know which sets of writes form a
transaction.
re-organize code to mark start/end of group of atomic operations
create()
begin_transaction
update free list
update i-node
update directory entry
end_transaction
app sends writes to the logging system
there may be multiple concurrent transactions
e.g. if two processes are making system calls
Terminology
in-memory data cache
on-disk data
in-memory log
on-disk log
dirty vs clean
sync write vs async
problem:
uncommitted transactions use space in in-memory data cache
a problem for long-running transactions
(not a problem for file systems)
Cite as: Robert Morris, course materials for 6.824 Distributed Computer Systems Engineering,
Spring 2006. MIT OpenCourseWare (http://ocw.mit.edu/), Massachusetts Institute of
Technology. Downloaded on [DD Month YYYY].