Skip to content
Snippets Groups Projects
Commit a67f378b authored by Peter J. Keleher's avatar Peter J. Keleher
Browse files

auto

parent 60d09a5c
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ This contains some code for testing. You should be able to run: `python3 testing ...@@ -55,7 +55,7 @@ This contains some code for testing. You should be able to run: `python3 testing
Your task is to finish a few of the unfinished pieces in the two files. Your task is to finish a few of the unfinished pieces in the two files.
* (8 pts) Implement IX Locks in `transactions.py`: Currently the code supports S, X, and IS locks. So if a transaction needs to lock a tuple in the X mode, the entire relation is locked. This is of course not ideal and we would prefer to use IX locks (on the relation) to speed up concurrency. The code for this will largely mirror the code for IS. You will have to change the `getXLockTuple()` function and also the `compatibility_list` appropriately. * (8 pts) Implement IX Locks in `transactions.py`: Currently the code supports S, X, and IS locks. So if a transaction needs to lock a tuple in the X mode, the entire relation is locked. This is of course not ideal and we would prefer to use IX locks (on the relation) to speed up concurrency. The code for this will largely mirror the code for IS. You will have to change the `getXLockTuple()` function and also the `compatibility_list` appropriately.
* (4 pts) Implement `woundWait()` in `transactions.py` for deadlock mitigation. This is currently called only by the last test of our testing apparatus, and is every bit as simple as it looks. Choose "younger transactions" by virtue of their transaction IDs (younger w.r.t to transaction1 means that their transaction_id is greater than transaction1). * (4 pts) Implement `woundWait()` in `transactions.py` for deadlock prevention. This is currently called only by the last test of our testing apparatus, and is every bit as simple as it looks. Choose "younger transactions" by virtue of their transaction IDs (younger w.r.t to transaction1 means that their transaction_id is greater than transaction1).
* (8 pts) Function `detectDeadlocksAndChooseTransactionsToAbort()` in `transactions.py`: The deadlock detection code is called once every few seconds. You should analyze the `waits-for` graph and figure out * (8 pts) Function `detectDeadlocksAndChooseTransactionsToAbort()` in `transactions.py`: The deadlock detection code is called once every few seconds. You should analyze the `waits-for` graph and figure out
if there are any deadlocks and decide which transactions to abort to resolve it. This function only needs to decide which transactions to kill -- our code handles the actual abort (see `detectDeadlocks()`). if there are any deadlocks and decide which transactions to abort to resolve it. This function only needs to decide which transactions to kill -- our code handles the actual abort (see `detectDeadlocks()`).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment