分布式事务的流水线处理及并发控制的研究与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
在分布式环境中,事务的多个子事务通常在不同的结点上完成。当前,为了保证分布式事务的ACID特性,最广泛采用的提交协议是两阶段提交协议以及衍生出的三阶段提交协议等。然而,随着网络服务环境的发展,分布式事务也出现了一些新的问题,例如网络服务环境中的资源并发问题,处理时间很长的长事务问题等。本文针对网络服务环境中的这些新问题提出了串行长事务的流水线模型以及分布式事务的并发控制模型,并在此之上构建了一个网格事务处理平台及其应用系统。
     网络服务环境中的长事务通常需要运行很长时间,也需要长时间地锁住资源,会影响事务处理系统的效率。一般的解决方案是补偿事务模型,即允许子事务独立地提交,一旦事务失败只需要执行具有相反效果的补偿事务即可。然而,在很多情况下,补偿事务很难产生,而且有些事务是无法补偿的。本文针对于长事务中的串行长事务,提出了一种新的基于流水线的处理模型,令事务处理的过程由串行变为流水化处理,大大提升了事务处理的性能,且无需补偿事务。
     根据两阶段提交协议,分布式事务的子事务在执行时如果请求同一个资源时会发生死锁现象,包括局部事务死锁和全局事务死锁。本文针对局部事务死锁提出了基于资源复制的并发处理方案,允许请求同一个资源的多个子事务在资源副本上串行地执行,在避免死锁的情况下保证了事务的一致性和原子性。针对全局事务死锁,本文提出了基于时间戳的资源预定机制,在两阶段提交协议之前增加资源预定阶段,从而在事务执行之前就能够检测到死锁并进行规避,提高了事务处理的效率。此外,时间戳机制也有效了减少了事务饥饿的发生。
     基于面向服务的事务处理模型,本文还介绍了面向服务的网格事务处理平台及其应用系统的设计与实现。网格事务处理系统作为网格服务和实际应用之间的中间件软件,为各种网格事务提供了统一的协调接口,包括原子事务,长事务,实时事务,以及串行长事务等。建立在此之上的典型应用包括银行转账系统,旅行计划制定系统,股票交易系统,以及订单处理系统。
In distributed environment, the sub-transactions of a transaction often execute on different nodes. To ensure the ACID properties of distributed transactions,currently the most widely used commit protocol is the two-phase commit protocol and the extened three-phase commit protocol. However, with the development of web service, there are some new problems, for example, the resource concurrency in the web service environment, the long-running transactions, and so on. This paper proposes a pipeline processing model of serial long transactions and the concurrency model of distributed transactions according to these new problems, based on which a grid transaction processing platform and the application system are constructed.
     The long transactions in web service environment always take a long time and lock the resource, which will bring down the efficiency of the transaction processing. The normal solution is the compensating transaction, which permits the sub-transactions to commit independently. Once the trasanction fails, The compensating transaction with the opposite effect. However, the compensating transaction is difficult or even impossible to create in many cases. This paper proposed a novel pipeline-based processing model for the serial long transactions, which pipelines the transaction processing and improves the performance evidently without compensating transaction.
     According to the two-phase commit protocol, there will be deadlock when the sub-transactions of distributed transactions request the same resource, including the local deadlock and the global deadlock. This paper proposes a new concurrent solution based on resource replica for the local deadlock, which allows the sub-transactions to execute serially on the resource replica and satisfies the atomicy and the coherency without deadlock. For the global deadlock, this paper proposes the resource reserving machanism based on time stamp, which adds a new resource reserving phase beefore the two phases of 2PC protocol. The new machanism could detect and avoid the dealock before executing the transactions, inhence improves the efficiency of transaction processing. Besides, the time stamp could reduce the starvation of the transaction.
     This paper also introduces the design and implementation of the service oriented grid transaction processing platform and application system. As the middleware between the grid service and application, the grid transaction processing system provide a uniform interface for the grid transaction, including the atomic transaction, the long transaction, the real-time transaction, the serial long transaction and so on. The application system on it consists of the bank transfering system, the travel planning system, the stock trading system, and the order processing system.
引文
[1] Gray Jim. The Transaction Concepts: Virtues and Limitations. In Proc. the 7th International Conference on Very Large Data Bases, Cannes, France, Sep, 1981, 144-154.
    [2] Silberschatz Abraham, Korth Henry F., Sudarshan S.. Database System Concepts, Forth Edition. USA, McGraw-Hill Companies, 2002.
    [3] Traiger Irving L., Gray Jim, Galtieri Cesare A. et al. Transactions and Consistency in Distributed Database Systems. ACM Transactions on Database Systems, Sep, 1982, 7(3), 323-342.
    [4] Lampson Butler, Sturgis Howard. Crash Recovery in a Distributed Data Storage System. Technical report, Computer Science Laboratory, Xerox Palo Alto Research Center, Palo Alto, 1976.
    [5] Gray Jim. Notes on Database Operating Systems. Operating systems: An Advanced Course. Lecture Notes in Computer Science 60, Berlin, Springer-Verlag, 1978, 393-481.
    [6] Garcia Molina H, Salem K. SAGAS. In Proc. The 1987 ACM SIGMOD International Conference on Management of Data, California, United States, May, 1987, pp.249-259.
    [7] Feilong Tang, Minglu Li and Jian Cao. A Transaction Model for Grid Computing. Advanced Parallel Processing Technologies. Lecture Notes in Computer Science, 2003, Volume 2834/2003, pp.382-386.
    [8] Ceponkus A, Cox W, Brown G et al. Business transaction protocol V1.0. 2002, http://www.oasis-open.org/committees/download.php.
    [9] Cabrera F, Copel G, Coxetal B. Web Services Transaction (WS-Transaction), August 2002, http//www.ibm.com/developerworks/library/ws-transpec.J. Clerk Maxwell, A Treatise on Electricity and Magnetism, 3rd ed., vol. 2. Oxford: Clarendon, 1892, pp.68–73.
    [10] Chrysanthis P, Ramamriham K. ACTA: The SAGA Continues. Chapter 10 of Transactions Models for Advanced Database Applications. Morgan Kaufmann, 1992.
    [11] Feilong Tang, Ming-Lu Li, Joshua Zhexue Huang. Automatic Transaction Compensating for Reliable Grid Applications. Journal of Computer Science and Technology. July 2006, Vol.21, No.4, pp.529-536.
    [12] Sotiris Moschoyiannis, Amir R Razavi, Yongyan Zheng, Paul Krause. Long-running Transactions: semantics, schemas, implementation. Second IEEE International Conference on Digital Ecosystems and Technologies, 2008, pp.20-27.
    [13] Jeffrey Fischer, Rupak Majumdar. Ensuring Consistency in Long Running Transactions. UCLA Computer Science Dept. Technical Report TR-070011, 2007.
    [14] M. Sch?fer, P. Dolog, W. Nejdl. An environment for flexible advanced compensations of web service transactions. ACM Transactions on the Web, 2008, vol.2, issue 2
    [15] Zhengwei Qi, Jinyuan You, Ying Jin and Feilong Tang. GridTP Services for Grid Transaction Processing. Grid and Cooperative Computing Lecture Notes in Computer Science, 2004, Volume 3033/2004, 891-894.
    [16] Feilong Tang, Minglu Li, Joshua Zhexue Huang, Cho-Li Wang and Zongwei Luo. Petri-Net-Based Coordination Algorithms for Grid Transactions. Parallel And Distributed Processing And Applications. Lecture Notes in Computer Science, 2005, Volume 3358/2005, 499-508.
    [17] Lindsay, B.G., P.G. Sellinger, C. Galtieri, J. Gray, R.A. Lorie, T.G. Price, G.F. Putzolu, IlL. Traiger, and B.W. Wade. (1979). "Notes on Distributed Databases." IBM San Jose Research Laboratory, RJ2571(33471).
    [18] X/Open CAE Specification, X/Open Distributed Transaction Processing: Reference Model, Version 3 (ISBN: 1-85912-170-5, G504), February 1996.
    [19] Ahmed K. Elmagarmid. A survey of distributed deadlock detection algorithms. ACM SIGMOD Record. Volume 15 Issue 3, Sept, 1986, Pages 37-45.
    [20] Ezpeleta, J.; Colom, J.M.; Martinez, J.; A Petri net based deadlock prevention policy for flexible manufacturing systems. IEEE Transactions on Robotics and Automation. Volume 11, Issue 2, Apr 1995, page 173-184.
    [21] Micha Hofri. On timeout for global deadlock detection in decentralized database systems. Information Processing Letters. Volume 51, Issue 6, 26 September 1994, Pages 295-302.
    [22] Dotoli, M., Fanti, M.P. Iacobellis, G., Comparing deadlock detection and avoidance policies in automated storage and retrieval systems, 2004 IEEE International Conference on Systems, Man and Cybernetics, vol 2, 2004, pp.1607-1612.
    [23] Y. Wang, M. Marritt, A. Romanovsky, Guaranteed Deadlock Recovery: Deadlock Resolution with Rollback Propagation, University of Bologna, 1998.
    [24] Dalal S, Temel S, Little M et al. Coordinating business transactions on the Web. IEEE Internet Computing, 2003, 791):30-39.
    [25] R. Casado, J. Tuya. Testing transactions in service oriented architectures. 9th Int. conf. on Web Engineering, DC, 2009.
    [26] N. Lakhal, T. Kobayashi, H. Toyota. FENECIA: failure endurable nested-transaction basedexecution of composite Web services with incorporated state analysis. VLDB Journal, 2009, vol.1,pp.1-56.
    [27] R. Lanotte, A. Maggiolo-Schettini, P. Milazzo, A. Troina. Design and verification of long-runningtransactions in a time framework. Science of Computer Programming, 2008, vol.73, pp.76-94.
    [28] Ruben Casado, Javier Tuya, Muhammad Younas. Testing Long-lived Web Services TransactionsUsing a Risk-based Approach. 10th International Conference on Quality Software, 2010, pp.337-340.
    [29] M. Emmi and R. Majumdar. Verifying compensating transactions. In VMCAI'07. ACM, 2007.
    [30] Frederic Montagut, Refik Molva, Silvan Tecumseh Golega. The Pervasive Workflow: ADecentralized Workflow System Supporting Long-Running Transactions. IEEE transactions on systems,man, and cybernetics-part C: Applications and reviews, 2008, vol.38, No.3, pp.319-333.
    [31] M. Little. Transactions and Web services. Commun. ACM, 2003, vol.46, no.10, pp.49-54.
    [32] Soojung Lee, Junguk L. Kim, Performance Analysis of Distributed Deadlock Detection AlgorithmsIEEE Transactions on Knowledge and Data Engineering, v.13 n.4, p.623-636, July 2001.
    [33] Ajay D. Kshemkalyani , Mukesh Singhal, A One-Phase Algorithm to Detect Distributed Deadlocksin Replicated Databases, IEEE Transactions on Knowledge and Data Engineering, v.11 n.6, p.880-895,November 1999.
    [34] H. Wu, WN. Chin, AND J. Jaffar, An effcient distributed deadlock avoidance algorithm for theAND model, IEEE Transactions on Software Engineering, 28 (2002), pp. 18–29.
    [35] J.W. Havender. Avoiding deadlock in multitasking systems. IBM Systems Journal, 7(2):74–84,1968.
    [36] W. D. Zhu, J. Cerruti, A. A. Genta, H. Koenig, H. Schiavi, and T. Talone, IBM Content ManagerBackup/Recovery and High Availability: Strategies, Options and Procedures, IBM Redbook, Mar. 2004.
    [37] Chessell M., Ferreira C., Griffin C. et al. Extending the Concept of Transaction Compensation.IBM Systems Journal, 2002, 41(4), 743-758.
    [38] Chrysanthis Panos K., Ramamritham Krithi. Synthesis of Extended Transaction Models UsingACTA. ACM Transactions on Database Systems, 1994, 19(3), 450-491.
    [39] Farrag A.A. and ?zsu M.T.. Using Semantic Knowledge of Transactions to Increase Concurrency.ACM Transactions on Database Systems, 14 (4), 503-525.
    [40] Garcia-Molina Hector. Using Semantic Knowledge for Transaction Processing in DistributedDatabase. ACM Transactions on Database Systems, 1983, 8 (2), 186-213.
    [41] Breitbart Y., Silberschatz A., Thompson G.. Reliable Transaction Management in a MultidatabaseSystem. Proc. of the ACM SIGMOD Conference on Management of Data, 1990.
    [42] Lynch N. A. Multilevel Atomicity– A New Correctness Criterion for Database Concurrency Control . ACM Transactions on Database Systems, 1983, 8(4), 484-502.
    [43] Lynch N. A., Merritt M., Weihl W. et al. Introduction to the Theory of Nested Transactions. Proc. of the International Conference on Database Theory, 1986.
    [44] Abbott A., Garcia-Molina Hector. Scheduling Real-Time Transactions: A Performance Evaluation. ACM Transactions on Database Systems, 1999, 17(3), 513-560.
    [45] Moss J.E.B.. Nested Transactions: An Approach to Reliable Distributed Computing. MIT/LCS/TR-260, Laboratory for Computer Science, Massachusetts Institute of Technology, Cambridge, USA, 1981.
    [46] Gu N., Xu X.B., Shi B.L.. Design and Implementation of an Interoperable Object Platform for Multi-Databases. Journal of Computer Science and Technology, May, 2000, 15(3), 249-260.
    [47] Georgakopoulos D., Hornick M.F., Manola F.. Customizing Transaction Models and Mechanisms in a Programmable Environment Supporting Reliable Workflow Automation. IEEE Transactions on Knowledge and Data Engineering. Aug, 1996, 8(4), 630-649.
    [48] Ammann P., Jajodia S., Ray I.. Applying Formal Methods to Semantic-Based Decomposition of Transactions. ACM Transactions on Database Systems (TODS), Jun, 1997, 22(2), 215-254.
    [49] Davidson S. B., Garcia-Molina Hector, Skeen D.. Consistency in a Partitioned Network: a Survey. ACM Computing Surveys (CSUR), Sep, 1985, 17(3), 341-370.
    [50] Wachter H, Reuter A. Contracts: A Means for Extending Control beyond Transaction Boundaries. Proceedings of the Second International Workshop on High Performance Transaction Systems, Pacific Grove, California, 1989.
    [51] Bernstein Philip, Goodman Nathan. Concurrency Control in Distributed Database Systems. ACM Computing Surveys (CSUR), Jun, 1981, 13(2), 185-221.
    [52] Mohan C., Lindsay B., Obermarck R.. Transaction Management in the R* Distributed Database Management System. ACM Transactions on Database Systems, Dec, 1986, 11(4), 373-396.
    [53] Gray Jim, Lorie R. A., Putzolu G. R. et al. Granularity of Locks and Degrees of Consistency in a Shared Data Base. Proc. of the International Conference on Very Large Databases, Sep, 1975, 428-451.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700