DIRECTORY BasicTime USING [GMT], YggEnvironment, YggImport USING [Handle], YggInternal USING [LogRecordID, nullLogRecordID], Rope USING [ROPE]; YggCoordinator: CEDAR DEFINITIONS LOCKS c USING c: Handle = BEGIN Object: TYPE = MONITORED RECORD [ transID: YggEnvironment.TransID _ TRASH, --immutable-- beginRecord: YggInternal.LogRecordID _ YggInternal.nullLogRecordID, --immutable-- state: State _ active, outcome: Outcome _ unknown, finishInProgress: BOOL _ FALSE, aWorkerBecameReady: BOOL _ FALSE, workers: WorkerHandle _ NIL, resultsReturned: CONDITION, forceRecord: YggInternal.LogRecordID _ YggInternal.nullLogRecordID, extras: REF Info _ NIL, next: Handle _ nullHandle ]; Handle: TYPE = REF Object; nullHandle: Handle = NIL; State: TYPE = {active, collecting, completing, complete}; Outcome: TYPE = YggEnvironment.Outcome --{abort, commit, unknown}--; WorkerObject: TYPE = RECORD [ worker: YggImport.Handle, --immutable-- state: WorkerState _ active, --increases monotonically from active to complete-- communicationTrouble: BOOL _ FALSE, callInProgress: Call _ none, --communication in progress with worker-- resultsOfMostRecentCall: Results _ [none, none[]], timeForNextCall: BasicTime.GMT _ TRASH, lastPrepareResult: Results _ [none, none[]], lastFinishResult: Results _ [none, none[]] ]; WorkerHandle: TYPE = LIST OF WorkerObject; WorkerState: TYPE = { active, ready, complete }; Call: TYPE = { none, prepare, finish }; Results: TYPE = RECORD [ communicationError: CommunicationError, body: SELECT call: Call FROM none => [], prepare => [prepareResult: YggEnvironment.WorkerState], finish => [] ENDCASE ]; Info: TYPE = RECORD [userRName: Rope.ROPE]; CommunicationError: TYPE = { none, bindingFailed, callFailed, busy }; RegisterWorkerLogRep: TYPE = MACHINE DEPENDENT RECORD [ worker: StrBody]; CompletingLogRep: TYPE = MACHINE DEPENDENT RECORD [ outcome: YggEnvironment.CommitOrAbort]; StrBody: TYPE = MACHINE DEPENDENT RECORD [ length: CARDINAL _ 0, maxLength: CARDINAL _ 64, text: PACKED ARRAY[0..64) OF CHAR]; END. CHANGE LOG. tYggCoordinator.mesa Copyright Σ 1985, 1988 by Xerox Corporation. All rights reserved. Defines the volatile state of a coordinator. Last edited by MBrown on January 30, 1984 11:51:40 am PST Kupfer, June 29, 1984 2:56:51 pm PDT Hauser, March 7, 1985 2:34:42 pm PST Bob Hagmann April 21, 1988 4:10:20 pm PDT increases monotonically from active to complete Changes to abort or commit during state transition collecting -> completing. A process that sets this TRUE is responsible for finishing the transaction. TRUE iff some worker returns "ready" from WorkerPrepare call. Elements added only when state = active. Finish process waits here for remote calls to return, or for timeout in order to delay sending new calls. ID of log record following last-written coordinator log record Extra info about the coordinator. Right now just the RName of the caller. CoordinatorMap data structure meaningful only if communicationTrouble bindingFailed means that no call was made callFailed means that call may or may not have been made busy is equivalent to callFailed, but retrying is more likely to succeed. Format of persistent coordinator state. Note that coordinatorBegin and coordinatorComplete log records contain no information other than the transaction ID, so we don't define structures for them here. Edited on June 29, 1984 10:31:34 am PDT, by Kupfer changes to: Coordinator: add an "extras" field to the Coordinator Object. This lets up keep things like user RName (and easily change what we keep), though at some point the extras should get merged back into the Object definition proper. Hauser, March 7, 1985 2:34:00 pm PST Added copyright. Κz˜šœ™IcodešœB™B—Jšœ,™,šœ™Jšœ*™*J™$K™$K™)—˜šΟk ˜ Jšœ œœ˜J˜Jšœ œ ˜Jšœ œ ˜1Jšœœ˜J˜——šœœœœ ˜;Jš˜J˜šœœ œœ˜!Jšœ"œΟc ˜6JšœDž ˜Q˜Jšœ/™/—˜JšœL™L—šœœœ˜JšœK™K—šœœœ˜!Jšœ=™=—šœœ˜Jšœ(™(—šœ œ˜JšœD™DJšœ$™$—šœC˜CJšœ>™>—šœœœ˜JšœJ™J—˜Jšœ™—J˜—Jšœœœ˜Jšœœ˜J˜Jšœœ.˜9J˜Jšœ œžœ˜DJ˜šœœœ˜Jšœž ˜'Jšœž3˜PJšœœœ˜#Jšœž)˜FJ˜2šœœœ˜'Jšœ'™'—J˜,J˜*J˜—Jšœœœœ˜*J˜Jšœ œ˜0Jšœœ˜'šœ œœ˜J˜'šœœ ˜J˜ J˜7J˜ Jš˜—J˜—J˜Jšœœœœ˜+J˜šœœ-˜EJšœ)™)Jšœ8™8JšœI™IJ˜—Jšœ'™'JšœU™UJšœK™KJ˜š œœœ œœ˜7J˜—š œœœ œœ˜3J˜'—š œ œœ œœ˜*Jšœœœ˜/Jš œœœœœ˜#J˜—Jšœ˜Iunitšœœ˜ ™2Jšœ Οr œΨ™ο——™$K™—K™—…—ς