Previous: Introduction :
Class RecoveryMgr{
public :
Status Rollback(); /* Aborts the current transaction */
Status Restart(); /* Restarts the database */
Status Checkpoint(); /* Takes a checkpoint */
Status RecoverEarliestLSN(lsn_t lsn);
/*
Returns the earliest LSN needed by the Recovery Mgr
This is used by the log manager for log compaction
*/
Status WriteUpdateLog(int size,int pgid,int offset,
void *old_data,void *new_data,Page* pg);
/* Writes Update log rec */
Status WriteCommitLog(lsn_t& lsn); // Writes commit log rec
Status WriteAbortLog(lsn_t& lsn); // Writes abort log rec
Status GetRecoveryLSN(int pgid, lsn_t lsn);
private :
- - - -
- - - -
};
The Rollback() method performs transaction rollback on an aborted
transaction.
The transaction
number is implicit as every process has its own 'current' transaction variable.
Restart(), Rollback() and Checkpoint() perform the functions
as described in Section 1. These functions are invoked by
the Log Manager.
WriteUpdateLog(),
WriteCommitLog() and WriteAbortLog() create appropriate update,
commit and abort log records which are written to the log file, by the Log
Manager. These are used by all sub-systems that access and modify pages in
the buffer pool : for example, the Space Manager and all access methods.