Appendix B : Implementation of the Data Manager Resource

var t: int # index into the status table # search transaction table for entry for tid. let t be index of entry : : : # write modified objects to the "non-current" copy fa i := 1 to statusTable[t].numDataItems-> ss.write(statusTable[t].dataAddrs[i] + (currentPointers mod 2 + 1), sizeof(data), statusTable[t].memCopy[i]) af free(statusTable[t].memCopy) end prepareToCommit proc commit(tid) var t: int # index into the status table # search transaction table for entry for tid, let t be index of entry : : : # if entry cannot be found, return-transaction has committed already : : : if statusTable[t].transStatus = 'A'-> # transaction hasn't committed yet # replace current pointers of data items by new current pointers fa i := 1 to statusTable[t].numDataItems-> ss.write(statusTable[t].dataAddrs[i], sizeof(int), (currentPointers mod (sizeof(data)+1) + 1)) af statusTable[t].transStatus := 'D' # mark transaction as done fi if statusTable[t].transStatus = 'D'-> # cleanup ss.write(statusTable + t*sizeof(transInfoRec), sizeof(trans), statusTable[t]) lockManager.unlock(tid, statusTable[t].dataAddrs) statusTable[t].transStatus := 'E' # mark table slot as being empty ss.write(statusTable + t*sizeof(transInfoRec), sizeof(trans), statusTable[t]) fi end commit Figure 11: prepareTocommit and commit Operations 24 proc read(tid, dataAddrs, data, numDataItems); # search transaction table for entry for tid. let t be index of entry : : : fa i := 1 to numDataItems-> j = 1; do (statusTable[t].dataAddrs[j] != dataAddrs[i]-> j++ od data[i] = statusTable[t].memCopy[j] af end read Figure 10: read Operation items in the stable store to point to the new version written by prepareToCommit. Following this, the status of the transaction is changed to done ('D') in both the volatile and stable storage versions. The data items are then unlocked. Finally, the transaction status is changed to empty ('E'), with the change being reflected onto stable store as well. Since the transaction manager that coordinates the various data managers may reissue commits when recovering from a failure, the commit operation may be re-executed in part or in total an arbitrary number of times given inopportune failures. Our implementation takes this into account by constructing this operation as a restartable action. The abort operation is similar to the commit and is therefore omitted for brevity. Here we present the rest of the procs exported by the data manager described in Section 4. As outlined there, the data manager keeps track of all in-progress transactions in a status table transStatus. proc startTransaction(tid, dataAddrs, numDataItems) var t: int # index into the status table P(statusTableMutex); # find an empty slot t …

[1]  R.D. Schlichting,et al.  A multi-paradigm programming language for constructing fault-tolerant, distributed systems , 1992, [1992] Proceedings 11th Symposium on Reliable Distributed Systems.

[2]  Henri E. Bal A comparative study of five parallel programming languages , 1992, Future Gener. Comput. Syst..

[3]  André Schiper,et al.  Lightweight causal and atomic group multicast , 1991, TOCS.

[4]  Flaviu Cristian,et al.  A Linguistic Approach to Failure Handling in Distributed Systems , 1991 .

[5]  Fred B. Schneider,et al.  Implementing fault-tolerant services using the state machine approach: a tutorial , 1990, CSUR.

[6]  Larry L. Peterson,et al.  The x-kernel: a platform for accessing internet resources , 1990, Computer.

[7]  William E. Weihl Using transactions in distributed applications , 1990, Digest of Papers Compcon Spring '90. Thirty-Fifth IEEE Computer Society International Conference on Intellectual Leverage.

[8]  Louise E. Moser,et al.  Broadcast Protocols for Distributed Systems , 1990, IEEE Trans. Parallel Distributed Syst..

[9]  Paulo Veríssimo,et al.  The Delta-4 approach to dependability in open distributed computing systems , 1988, [1988] The Eighteenth International Symposium on Fault-Tolerant Computing. Digest of Papers.

[10]  Santosh K. Shrivastava,et al.  Rajdoot: A Remote Procedure Call Mechanism Supporting Orphan Detection and Killing , 1988, IEEE Trans. Software Eng..

[11]  Gregory R. Andrews,et al.  An overview of the SR language and implementation , 1988, TOPL.

[12]  Richard J. LeBlanc,et al.  System Programming with Objects and Actions , 1985, ICDCS.

[13]  Richard D. Schlichting,et al.  Fail-stop processors: an approach to designing fault-tolerant computing systems , 1981, TOCS.

[14]  Leslie Lamport,et al.  The Byzantine Generals Problem , 1982, TOPL.

[15]  Per Brinch Hansen,et al.  The programming language Concurrent Pascal , 1975, IEEE Transactions on Software Engineering.