Last edited by:
MBrown on January 30, 1984 5:24:32 pm PST
Taft on April 6, 1983 5:14 pm
Hauser, March 7, 1985 2:56:14 pm PST
Carl Hauser, March 18, 1986 10:23:20 am PST
FileLog:
DEFINITIONS =
BEGIN
FileID: TYPE = AlpineEnvironment.FileID;
LockSubID: TYPE = AlpineInternal.LockSubID;
LogRecordID: TYPE = AlpineInternal.LogRecordID;
OwnerName: TYPE = AlpineEnvironment.OwnerName;
PageCount: TYPE = AlpineEnvironment.PageCount;
PageRun: TYPE = AlpineEnvironment.PageRun;
ReferencePattern: TYPE = AlpineEnvironment.ReferencePattern;
TransState: TYPE = AlpineInternal.TransState;
VolumeID: TYPE = AlpineEnvironment.VolumeID;
Exported from FileLogImpl, for writing and reading log records during normal operation
LogCreate:
PROCEDURE [fileInstance: FileInstance.Handle, initialSize: PageCount, owner: OwnerName];
! Log.WriteFailed;
Logs the creation of a file (as an undo action). Note: this operation forces the log to stable storage.
LogDelete:
PROCEDURE [fileInstance: FileInstance.Handle];
! Log.WriteFailed;
Logs the deletion of a file (as a deferred action).
LogSetSize:
PROCEDURE [fileInstance: FileInstance.Handle, old, new: PageCount];
! Log.WriteFailed;
Logs a change in the size of a file. old should be the committed size of the file. This is a deferred action if new<old, an undo action if new>old.
LogWritePages:
PROCEDURE [fileInstance: FileInstance.Handle, where:
LONG
POINTER, pageRun: PageRun, referencePattern: ReferencePattern]
RETURNS [recordID: LogRecordID];
! Log.WriteFailed;
Writes a writePages log record from memory.
LogReadPages:
PROCEDURE [fileInstance: FileInstance.Handle, where:
LONG
POINTER, pageRun: PageRun, recordID: LogRecordID]
RETURNS [referencePattern: ReferencePattern];
Reads the specified pageRun interval of the file designated by fileInstance into memory starting at where. recordID identifies a writePages record which the caller asserts includes the requested interval. Returns the ReferencePattern which was passed to LogWritePages. A fatal error occurs if pageRun is not a subinterval of the pageRun actually contained in the log record or if the log record describes a write to the wrong file.
LogWriteLeaderPages:
PROCEDURE [fileInstance: FileInstance.Handle, leaderPage: LeaderPageFormat.LeaderPageHandle]
RETURNS [recordID: LogRecordID];
! Log.WriteFailed;
Writes a writeLeaderPage log record from memory.
LogReadLeaderPages:
PROCEDURE [fileInstance: FileInstance.Handle, recordID: LogRecordID]
RETURNS[ leaderPage: LeaderPageFormat.LeaderPageHandle ];
Reads a writeLeaderPage log record into memory. Raises WrongLengthRecord if the log record is not precisely the right length. A fatal error occurs if the log record describes a write to the wrong file.
LogChangeHWM:
PROCEDURE [fileInstance: FileInstance.Handle,
oldHWM, newHWM: PageCount];
! Log.WriteFailed;
Logs a change in the high water mark. The log record is not needed during recovery but is used by the log backup program. During recovery, just ignore it.
LogWritePagesToBase:
PROCEDURE [fileInstance: FileInstance.Handle,
pageRun: PageRun];
! Log.WriteFailed;
Logs changes to a file done by writing beyond the high water mark. The log record is not needed during recovery but is used by the log backup program. During recovery, just ignore it.
LogFileLock:
PROCEDURE [fileInstance: FileInstance.Handle];
! Log.WriteFailed;
Logs the setting of a file write lock (only write locks are logged).
Imported by FileLogImpl, for processing log records during recovery. Each takes as arguments the information that was passed to the corresponding WriteXXX procedure which wrote the log record, plus the transaction outcome which is {committed, aborted, ready}. Note that the calls are made only for files which still exist at recovery time.
RecoverCreate:
PROCEDURE [fileInstance: FileInstance.Handle, initialSize: PageCount, outcome: TransState];
Note: type and owner are not passed, as they are not actually needed for recovery, and constructing an owner string from the log record is a messy job.
RecoverDelete: PROCEDURE [fileInstance: FileInstance.Handle, outcome: TransState];
RecoverSetSize: PROCEDURE [fileInstance: FileInstance.Handle, old, new: PageCount, outcome: TransState];
RecoverWritePages: PROCEDURE [fileInstance: FileInstance.Handle, recordID: LogRecordID, pageRun: PageRun, outcome: TransState];
RecoverWriteLeaderPage: PROCEDURE [fileInstance: FileInstance.Handle, recordID: LogRecordID, outcome: TransState];
RecoverLock: PROCEDURE [fileInstance: FileInstance.Handle, lockSubID: LockSubID, outcome: TransState];