From 4f7d3fdc2839551edc53d313f35d1c579a6f14b3 Mon Sep 17 00:00:00 2001 From: "Peter J. Keleher" <keleher@cs.umd.edu> Date: Wed, 4 Dec 2019 13:42:33 -0500 Subject: [PATCH] auto --- README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++-- testingRecovery.py | 4 +-- 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4142acd..ed8fadd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## Project 5: Transactions, CMSC424, Fall 2019 -**v1.01** +**v1.03** **(Due Dec 8, midnight)** @@ -48,8 +48,6 @@ relations and tuples). **The code here and elsewhere implicitly assumes that the - `class TransactionState`: This class encapsulates some of the basic functionality of transactions, including some helper functions to create log records, keeping track of what locks the transaction currently holds, etc. -### Example logs and relations -In `recoverytests-original/` and `recoverytests-answers/` #### Development @@ -133,6 +131,73 @@ will also check for the lock messages ("able to get this lock on...", etc.). Our testing will check both the contents of the database (the final versions of the relation file) and the `logfile`. +Note that `testingRecovery.py` now uses **"relation"** instead of the original "relation1". + +Example logs and relations are +in `recoverytests-original/` and `recoverytests-answers/`. Copy them into the +current directory to run, as in: + + titan:~/p5> cp recoverytests-original/recoverytest1_logfile logfile + titan:~/p5> cp recoverytests-original/recoverytest1_relation relation + titan:~/p5> cat logfile + [1, "START"] + [2, "START"] + [3, "START"] + [4, "START"] + [5, "START"] + [6, "START"] + [5, "UPDATE", "recoverytest1_relation", "2", "A", "10", "7"] + [5, "UPDATE", "recoverytest1_relation", "21", "A", "10", "13"] + [4, "UPDATE", "recoverytest1_relation", "1", "A", "10", "7"] + [4, "UPDATE", "recoverytest1_relation", "11", "A", "10", "13"] + [6, "UPDATE", "recoverytest1_relation", "3", "A", "10", "7"] + [6, "UPDATE", "recoverytest1_relation", "31", "A", "10", "13"] + [5, "COMMIT"] + [4, "CLR", "recoverytest1_relation", "11", "A", "10"] + [6, "CLR", "recoverytest1_relation", "31", "A", "10"] + [4, "CLR", "recoverytest1_relation", "1", "A", "10"] + [4, "ABORT"] + [6, "CLR", "recoverytest1_relation", "3", "A", "10"] + [6, "ABORT"] + [1, "UPDATE", "recoverytest1_relation", "0", "A", "10", "20"] + [2, "UPDATE", "recoverytest1_relation", "10", "A", "10", "20"] + [3, "UPDATE", "recoverytest1_relation", "20", "A", "10", "20"] + [1, "COMMIT"] + [2, "COMMIT"] + [3, "COMMIT"] + titan:~/p5> python testingRecovery.py + Reading from 'logfile' and 'relation' + + Setting the last_tranasction_id to be 6 + Starting Restart Recovery....... + titan:~/p5> cat logfile + [1, "START"] + [2, "START"] + [3, "START"] + [4, "START"] + [5, "START"] + [6, "START"] + [5, "UPDATE", "recoverytest1_relation", "2", "A", "10", "7"] + [5, "UPDATE", "recoverytest1_relation", "21", "A", "10", "13"] + [4, "UPDATE", "recoverytest1_relation", "1", "A", "10", "7"] + [4, "UPDATE", "recoverytest1_relation", "11", "A", "10", "13"] + [6, "UPDATE", "recoverytest1_relation", "3", "A", "10", "7"] + [6, "UPDATE", "recoverytest1_relation", "31", "A", "10", "13"] + [5, "COMMIT"] + [4, "CLR", "recoverytest1_relation", "11", "A", "10"] + [6, "CLR", "recoverytest1_relation", "31", "A", "10"] + [4, "CLR", "recoverytest1_relation", "1", "A", "10"] + [4, "ABORT"] + [6, "CLR", "recoverytest1_relation", "3", "A", "10"] + [6, "ABORT"] + [1, "UPDATE", "recoverytest1_relation", "0", "A", "10", "20"] + [2, "UPDATE", "recoverytest1_relation", "10", "A", "10", "20"] + [3, "UPDATE", "recoverytest1_relation", "20", "A", "10", "20"] + [1, "COMMIT"] + [2, "COMMIT"] + [3, "COMMIT"] + [-1, "CHECKPOINT", []] + titan:~/p5> ### Submission diff --git a/testingRecovery.py b/testingRecovery.py index cfbac47..490a8e8 100644 --- a/testingRecovery.py +++ b/testingRecovery.py @@ -10,8 +10,8 @@ from exampletransactions import * ##################################################################################################### # Initial Setup -print("Reading from '{}' and '{}\n".format("logfile", "relation1")) +print("Reading from '{}' and '{}'\n".format("logfile", "relation")) bpool = BufferPool() -r = Relation('relation1') +r = Relation('relation') LogManager.setAndAnalyzeLogFile('logfile') -- GitLab