Distributed Transaction Management, Autumn 2003 , Exercise 3 Due Tue 11.11.2003 1. Change the LockManager implementation so that a client first contacts one server, which gives it a txn id. Then, when the client opens a connection to the other servers, it first tells them its txn id. One possible way to form a txn id of type Long goes as follows: Suppose the servers are given short integer ids. Take the current time as Long, shift it left by 16 bits, and put the server id in the Long as the 16 rightmost bits. Then you get ids, which can be used to order txns by age and ties are solved by using the server id. LockManager implementation can be found from http://www.cs.uta.fi/~jyrki/dtm03/LockManager.zip 2. Improve the implementation so that all servers know all other servers ids (e.g. by reading them from a configuration file, say, servers.txt). Then implement deadlock detection by using the method whereby the other servers just send their lock information to one of the servers, which constructs the overall lock graph. For testing purposes, you may just make one of the clients initiate the deadlock detection. 3. Consider decentralised 2PC. Suppose that when the txn is ready, someone (e.g. a client) initiates the voting by sending a Vote-Request to all servers (participants). When would using a termination protocol be appropriate and what should it be like? 4. Consider the example LockManager implementation. (a) Suppose that a 2PC implementation is added there and locks are released implicitly at commit/rollback. When would it make sense for a server to vote for No for a transaction (now that we are only managing locks). (b) The same question assuming that locks should be released explicitly before commit/rollback. 5. Add basic 2PC to your implementation (you may leave out termination and recovery and log management for now).