BackupLog.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Carl Hauser, March 12, 1986 10:45:21 am PST
DIRECTORY
AlpineInternal USING [LogRecordID, LogRecordType, BackupVolume, firstRecordID, lastRecordID, nullLogRecordID],
AlpineLog USING [Block],
Rope;
BackupLog: CEDAR DEFINITIONS
~ BEGIN
The backup log is a sequence of Cedar FS files, read and written using stream operations. Each file in the sequence starts with a record containing its own recordID. The recordID of each subsequent record is the sum of this first recordID and the word offset of the record in the file.
This interface does not yet have procedures for managing the sequence of files, remembering the order in which they occur, remembering the recordIDs on each file, the dates they correspond to, etc. These would be nice to have.
RecordType: TYPE = AlpineInternal.LogRecordType;
A tag of type RecordType is associated with each log record as it is written. This is
used to identify the recovery procedure responsible for the record.
RecordID: TYPE = AlpineInternal.LogRecordID;
Uniquely identifies a record within a log. The 48 bit address space allows for
several hundred years of log writing.
nullRecordID: RecordID = AlpineInternal.nullLogRecordID;
No log record is identified by this value.
BackupVolume: TYPE = AlpineInternal.BackupVolume;
firstRecordID: RecordID = AlpineInternal.firstRecordID;
for all r, Compare[firstRecordID, r] # greater
lastRecordID: RecordID = AlpineInternal.lastRecordID;
for all r, Compare[lastRecordID, r] # less
Block: TYPE = AlpineLog.Block;
OpenForNormalOperation: PROC [backupLogName: Rope.ROPE, initialPosition: RecordID] ;
Call once before calling Write;
Close: PROC [];
Call when done with backup log;
OpenForRecovery: PROC [backupLogName: Rope.ROPE] RETURNS [firstRecord: RecordID];
Call once before calling Read; firstRecord is the record the client should process first, not BackupLog's own header record.
ReadProcStatus: TYPE = {normal, destinationFull, sourceExhausted};
normal means destinationFull and sourceExhausted (normal termination for reading
a fixed-length log record).
ReadProc: TYPE = UNSAFE PROC [thisRecord: RecordID, wordsToSkip: LONG CARDINAL ← 0, to: Block]
RETURNS [status: ReadProcStatus, wordsRead: CARDINAL];
Read: ReadProc;
Extracts all or part of the contents of a log record whose type and transaction are
known, placing it in "to". Should be called during normal operation of the server
to carry out intentions.
Note: Perform recovery before calling any of the procedures below.
Log writing
Write: UNSAFE PROC [
continuation: BOOLEANFALSE,
recordData: Block, force: BOOLFALSE]
RETURNS [followingRecord: RecordID];
! NearlyFull, Full (online log is full - backup volume should be changed).
NearlyFull, Full: ERROR;
Force: PROC [];
Force all records previously written to be recorded
stably in the backup log.
Format: PROC [backupLogName: Rope.ROPE, pages: INT, firstRecordID: RecordID] RETURNS[firstUsableRecordID: RecordID];
This call formats the given file to a well-defined initial state that is acceptable to backup recovery. This should not be called while backup is running. The previous contents of the file is lost.
RecordIDOfNextWrite: PROC [] RETURNS [RecordID];
RecordID that Write would have returned as thisRecord, had it been called.
There is no way to guarantee that calling Write after calling this proc will
generate this RecordID, however.
END.
CHANGE LOG