4.4 The Log Manager



next up previous
Next: 5 Implementation Up: 4 Log Manager Interface Previous: 4.3 Shared Memory Structure

4.4 The Log Manager

 

The log manager is defined in class log. Every Minirel process will instantiate a global object of this class. Class log includes methods to

  1. Read a log record given its LSN.

  2. Read the log record that immediately follows the log record with the supplied LSN.

  3. Read the log record that immediately follows the supplied log record.

  4. Append a log record to the end of the log.

  5. Flush the log tail to disk. Anyone who wants the log tail flushed (except the buffer manager) will call log::flush. The buffer manager [Qiu & Su 95] will call log::bufmgr_flush. When log::flush is invoked, it will flush the log tail and inform the buffer manager of the last LSN that made it to disk. The buffer manager can use this information to enforce WAL efficiently. If the buffer manager wishes the log tail to be flushed, it calls log::bufmgr_flush which will flush the log tail and return the last LSN that made it.

  6. Return the LSN that will be assigned to the next log record written.

  7. Read/write access to the master log record.

Class log is also used to create and initialize new log files.



ajitk@cs.wisc.edu, cjin@cs.wisc.edu