• 140 likes • 364 Views
Cost-based Distributed Transaction Coordinator. Jin Taiyong 08/22/2001. T1. T2. T3. T4. Architecture. Functionalities of Execute Element. Transaction Pool. Execute the coordinated transactions. Transaction Scheduler. Database Distribution Manager. Load Information
E N D
Cost-based Distributed Transaction Coordinator JinTaiyong 08/22/2001
T1 T2 T3 T4 Architecture Functionalities of Execute Element Transaction Pool • Execute the coordinated transactions Transaction Scheduler Database Distribution Manager Load Information Manager • Collect the load information of the executed transactions Execute Element Manager Adapter Dispatcher • Feedback the load information of the executed transactions to transaction coordinator Dispatcher Dispatcher Dispatcher Dispatcher Execute Element Dispatcher Execute Element Execute Element • Transaction Placement Policy: • Decide how to coordinate the transaction when it is submitted to TC • Transaction Scheduling Policy: • Decide which blocked transaction in Transaction Pool is executed • at which site when a transaction is finished at an Execute Element
Transaction Type • In actual applications, the number of the transaction types is limited. • The transactions whose types are the same should have the same load characteristic • The transaction type is decided by the designer of the application
DataStructure (1) • TransactionPool(TC_WaitTransactionList) • BlockedTransaction( TC_WaitTran ) • Type: int • Priority: int • Param Size: unsigned long • Parameter: char* • Next blocked tranaction: TC_WaitTran* TC_WaitTransactionList TC_WaitTran
DataStructure (2) • Database Distribution Manager (DDM) • DDMInfo_t • Heap_number: int • Primary IP address: unsigned long • Heap Size: unsigned long • DDMInfo_t DDM
DataStructure (3) • Cost Information Manager (CIM) • CIMHeapInfo_t • ddm_entry: int • Number of read pages: int • Number of written pages: int • CIMInfo_t • Type: int • Throughput: int • Rollback: int • Cost Value: CIMHeapInfo_t[MAX_HEAP_NUM] • CIMnfo_t CIM
DataStructure (4) • Execute Element Manager (EEM) • EESocket • handle: int • IP address: unsigned long • Port: int • Busy Flag: int (1: The EE is executing a transaction; 0: The EE is idle) • Connect_flag: int (1: The EE is connecting with TC; 0: The EE is disconnected with TC) • TC_EEManager • Sockets: EESocket[MAX_EE_NUM] • Max MPL: int ( The maximum number of the EEs whose Busy Flag is 1) • Current MPL: int
DataStructure (5) • Execute Element (EE) • Socket Handle: int • RPC Handle: Client* • IP Address: unsigned long • Port: int
When an EE is executed TC • TransactionEnd • IP Address • Port • (RPC) • TypeID • Parameter • (Socket) EE_Open(ip_addr, port) (RPC) Transaction Action Library EE
Relationship between Transaction Load Information and CDTC • CDTC is based on the cost of transactions executed at Execute • element • The cost of transaction is different from the site where the • transaction execute • The cost of transaction is decided by the load information • and the cost of the transaction could be calculated via the • load information and the distribution status of database • The load information of the transactions is collected while the EEs execute these transactions
Cost-based Approaches • Cost-based Approach - 1 • Static approach(CTC-Static) • Static Coordinator Description File(SCDF) T S • T is the type ID of transaction • S is the ip address of the host where the transaction t is executed. • Transaction Placement Policy • Select an idle EE for the submitted transaction according to SCDF • Transaction Scheduling Policy • Select the next transaction which is blocked also according to SCDF
Cost-based Approaches • Cost-based Approach - 2 • Transaction Priority Oriented approach(CTC-TPOA) • Transaction Placement Policy Look through all of the EEs to find an idle EE to execute the transaction submitted • Transaction Scheduling Policy Look through all of the EEs to find an idle EE to execute the blocked transaction whose arrival time is the earliest.
Cost-based Approaches • Cost-based Approaches -3 • Low-Cost Oriented approach(CTC-LCOA) • Priority Value (PV) PV(t, s) = Cost(t,s) – Preemption Factor(t) • Cost(t,s)is the cost for executing t at host s. • If a transaction whose arrival time is laterthan that Of t is coordinated in prior to t, the Preemption Factor of t is increased by k • Transaction Placement Policy It is the same with CTC-TPOA • Transaction Scheduling Policy For the site where the EE has finished a transaction, look through all of the blocked transaction and coordinate the transaction whose PV is the lowest to the site Distribution of Active EEs is fixed in CTC-LCOA
Relationship between Priority and cost-based approaches • Just in transaction scheduling policy, the priority is considered. • In CTC-Static, the priority is not be considered • In CTC-TPOA, just the priority is considered. • In CTC-LCOA, not only the priority but also the cost is considered.