Ch 6.Transaction Processing Monitors.ppt
《Ch 6.Transaction Processing Monitors.ppt》由会员分享,可在线阅读,更多相关《Ch 6.Transaction Processing Monitors.ppt(41页珍藏版)》请在麦多课文档分享上搜索。
1、1,Ch 6. Transaction Processing Monitors,Dr. Kien A. Hua,2,Transaction Processing Monitor,Transactional RPC. Functional Principles of the TP Monitor. Managing Request and Response Queues. Other tasks of TP Monitors Load Balancing Authentication and Authorization Restart Processing,3,Layering of Servi
2、ces in a Transaction Processing System (1),The Basic Operating System (BOS) uses the hardware directly. Examples: Process/Thread scheduling, file system, simple sessions, authentication, etc. Transaction Processing Operating System (TPOS) uses BOS to provide a transactional programming environment.
3、Examples: Server class, transaction manager, log, durable queue, transactional RPC, etc.,4,Layering of Services in a Transaction Processing System (2),Transaction Processing Services (TRAPS) use both BOS and TPOS to create a transaction-oriented programming environment. Examples: Programming environ
4、ment, load control, resource managers, databases, etc. The application typically uses the TRAPS and TPOS, depending on the applications sophistication.Note: These layers do not reflect a strict implementation hierarchy. Rather, it describes a separation of concerns among different system components
5、(e.g., TPOS can implement some of its data structures using SQL).,5,Coordination of Resource Managers (1),Transaction control must be exercised over all resource manager interactions within one transaction. The following are required for the “web” of a transactions calls to hang together: Control of
6、 participants: Someone must track which resource managers have been called. At commit time, the transaction manager (TM) must go out and ask each resource manager involved whether they agree to successfully terminate the transaction.,6,Coordination of Resource Managers (2),Preserving transaction-rel
7、ated information: At commit each process running the same resource manager code is asked individually about its commit decision. If the different invocations left their traces in different servers, the TRPC mechanism must provide a means to relate multiple invocations of the same resource manager to
8、 each other. Support of the transaction protocol: The resource managers must stick to the rules imposed by the ACID paradigm.,7,CALLBACK (1),Each resource manager has a service interface that defines what the resource manager does for a living. Furthermore, it declares a number of callback entries,
9、which can be called when certain events happen. If the RM maintains any durable objects, it must be able to accept rollback and prepare/commit callbacks from the TM. The RM exports the callback entries to the transaction manager when it first checks in with the TP monitor. The number of callback ent
10、ries provided by a RM depends on its level of sophistication. Note: This can result in multiple threads executing the RMs code at different entry points.,8,CALLBACK ENTRIES (1),9,CALLBACK ENTRIES (2),The function prototype declares are shown below. Note that the invocation of a resource manager by t
11、he transaction manager at such callback entry is just another transactional remote procedure call.Boolean rm_Prepare(); /* invoked at phase 1 of commit. Returns vote. */ Boolean rm_Rollback_Savepoint (Savepoint); /* rollback to requested savepoint number */* TRUE if ok, FALSE if needs further rollba
12、ck */Boolean rm_Commit (Boolean); /* invoked at phase 2 commit; param is decision */ Boolean rm_Savepoint (); /* invoked when the transaction takes a savepoint */* TRUE if ok, FALSE if this resource manager */* cannot establish the savepoint and must */* continue rollback */(void) rm_UNDO ( passes t
13、he address of the resource */* managers recent checkpoint record */,10,Installing a New Resource Manager (1),RMID rmInstall (RMNAME, /*other info. for TP monitor*/RMNAME is the user-supplied global external ID. &rm_callback is an array of pointers to the callback entries. These callback entries are
14、specified as relative addresses in the load module for that RM. The TP monitor keeps this array in the TRPC stub of the respective RMs address space.,11,Installing a New Resource Manager (2),RMID rmInstall (RMNAME, /*other info. for TP monitor*/AccessControlList allows the TP monitor to check whethe
15、r an incoming request for that RM is acceptable from a security point of view. Stuff denotes remaining parameters: The location from which the code for the resource manager can be loaded. Which other resource managers need to be available before this one can start, etc.,12,Resource Managers Interfac
16、es,Fig 6.2: Overview of a resource managers interfaces. The resource manager both uses interfaces from other system components and provides interfaces to other system components. There are three groups to be distinguished: the interface the resource manager exports, the interfaces it uses from other
17、 general resource managers and the system resource manager interfaces it has to call to support the transaction protocol.,13,Resource Manager Sessions,If a client C repeatedly invokes server class S, how should that be handled? We need to consider three scenarios.,14,Independent Invocations,A server
18、 class S can be called arbitrarily often, and the outcome of each call is independent of whether or not the server class has been called before. Example: The server reads records from a database. It performs some statistical computations on them, and returns the result. Since the server keeps no sta
19、te about the call, it can declares its consent to the transactions commit upon return.,15,Invocation Sequence,The client wants to issue requests that explicitly refer to earlier service requests. Example: The mini-batch example updates a number of records at a time (in a subtransaction) using a curs
20、or. The final decision of the server class depends on the outcome of the last invocation.,16,Complex Interaction,Each call to S is independent, except for some global integrity constraints that cannot be checked until commit and that may depend on the results of all previous invocations. The server
21、class must remember the results of all invocations by the client until commit.,17,Complex Interaction Example,Example: A mail server stores the various parts of a message in a database. It maintains a consistency constraint that says that all mails must have at least a header, a body and a trailer.T
22、here must be some way of relating all the updates done by the same client when the server is called (back) at rm_Prepare.,18,Implementing State Associated with a Client-Server Interaction,Context is maintained by a communication session. Context is passed back and forth. The servers write context in
23、formation to a database. The context is stored in a segment of shared memory for all servers of the same class.,Context information about multiple invocations of the same server class can be maintained in four different ways:,19,Context Management: Communication Session,Such a session has to be mana
24、ged by the TPOS. All the client or the server has to do is to declare that it need one. Typically, the request for a session is issued by the server. Applications do not want to be bothered with TPOS. The price for this is considerable overhead in the TPOS for maintaining and recovering sessions.,20
25、,Session Management,If context maintenance is handled thru communication session, then the TP monitor is responsible for binding a server process to one client for the duration of a stateful invocation. typedef struct /* */rmInstance EndA; /* one end of stateful interaction */rmInstance EndB; /* oth
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CH6TRANSACTIONPROCESSINGMONITORSPPT
