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

auto

parent 26a89fd1
No related branches found
No related tags found
No related merge requests found
Showing
with 266 additions and 3 deletions
......@@ -72,7 +72,17 @@ have to change the `getXLockTuple()` function and also the `compatibility_list`
* [20 points] Function `restartRecovery()` in `transaction.py`: This function is called if
the log file indicates an inconsistency (i.e., if the logfile does not end with an empty
CHECKPOINT record). If that's the case, then you must analyze the logfile and do a
recovery on that (see 16.4.2 for details).
recovery on that. See 16.4.2 for details, though:
* Our CLR records have a different format (see example logfiles for
details), and
* The book says to undo incomplete transactions in reverse order of their
start records. You should
undo tranactions *in the order they appear in the original log*, as shown
in the slides. The order that the transactions are undone does not matter,
as we have 2PL. There will never be more than a single incomplete
transaction that modifies a given record.
The individual operations of a single transaction, of course, are
a different matter.
For the recovery, you will need to write the code for both `revertChanges` and `restartRecovery`. `revertChanges` works by writing a compensating log
record (CLR) for each update that a failed transaction does, in the correct
......
[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", []]
[["ID", "A"], 10, {"24": 3, "25": 3, "26": 3, "27": 3, "20": 3, "21": 3, "22": 3, "23": 3, "28": 3, "29": 3, "0": 1, "4": 1, "8": 1, "59": 6, "58": 6, "55": 6, "54": 6, "57": 6, "56": 6, "51": 6, "50": 6, "53": 6, "52": 6, "88": 9, "89": 9, "82": 9, "83": 9, "80": 9, "81": 9, "86": 9, "87": 9, "84": 9, "85": 9, "3": 1, "7": 1, "39": 4, "38": 4, "33": 4, "32": 4, "31": 4, "30": 4, "37": 4, "36": 4, "35": 4, "34": 4, "60": 7, "61": 7, "62": 7, "63": 7, "64": 7, "65": 7, "66": 7, "67": 7, "68": 7, "69": 7, "2": 1, "6": 1, "99": 10, "98": 10, "91": 10, "90": 10, "93": 10, "92": 10, "95": 10, "94": 10, "97": 10, "96": 10, "11": 2, "10": 2, "13": 2, "12": 2, "15": 2, "14": 2, "17": 2, "16": 2, "19": 2, "18": 2, "48": 5, "49": 5, "46": 5, "47": 5, "44": 5, "45": 5, "42": 5, "43": 5, "40": 5, "41": 5, "1": 1, "5": 1, "9": 1, "77": 8, "76": 8, "75": 8, "74": 8, "73": 8, "72": 8, "71": 8, "70": 8, "79": 8, "78": 8}] [["0", "20"], ["1", "10"], ["2", "7"], ["3", "10"], ["4", "10"], ["5", "10"], ["6", "10"], ["7", "10"], ["8", "10"], ["9", "10"]] [["10", "20"], ["11", "10"], ["12", "10"], ["13", "10"], ["14", "10"], ["15", "10"], ["16", "10"], ["17", "10"], ["18", "10"], ["19", "10"]] [["20", "20"], ["21", "13"], ["22", "10"], ["23", "10"], ["24", "10"], ["25", "10"], ["26", "10"], ["27", "10"], ["28", "10"], ["29", "10"]] [["30", "10"], ["31", "10"], ["32", "10"], ["33", "10"], ["34", "10"], ["35", "10"], ["36", "10"], ["37", "10"], ["38", "10"], ["39", "10"]] [["40", "10"], ["41", "10"], ["42", "10"], ["43", "10"], ["44", "10"], ["45", "10"], ["46", "10"], ["47", "10"], ["48", "10"], ["49", "10"]] [["50", "10"], ["51", "10"], ["52", "10"], ["53", "10"], ["54", "10"], ["55", "10"], ["56", "10"], ["57", "10"], ["58", "10"], ["59", "10"]] [["60", "10"], ["61", "10"], ["62", "10"], ["63", "10"], ["64", "10"], ["65", "10"], ["66", "10"], ["67", "10"], ["68", "10"], ["69", "10"]] [["70", "10"], ["71", "10"], ["72", "10"], ["73", "10"], ["74", "10"], ["75", "10"], ["76", "10"], ["77", "10"], ["78", "10"], ["79", "10"]] [["80", "10"], ["81", "10"], ["82", "10"], ["83", "10"], ["84", "10"], ["85", "10"], ["86", "10"], ["87", "10"], ["88", "10"], ["89", "10"]] [["90", "10"], ["91", "10"], ["92", "10"], ["93", "10"], ["94", "10"], ["95", "10"], ["96", "10"], ["97", "10"], ["98", "10"], ["99", "10"]]
\ No newline at end of file
[1, "START"]
[2, "START"]
[3, "START"]
[4, "START"]
[5, "START"]
[6, "START"]
[7, "START"]
[6, "UPDATE", "recoverytest2_relation", "2", "A", "10", "0"]
[7, "UPDATE", "recoverytest2_relation", "4", "A", "10", "0"]
[4, "UPDATE", "recoverytest2_relation", "1", "A", "10", "7"]
[5, "UPDATE", "recoverytest2_relation", "3", "A", "10", "7"]
[4, "UPDATE", "recoverytest2_relation", "11", "A", "10", "13"]
[5, "UPDATE", "recoverytest2_relation", "31", "A", "10", "13"]
[5, "CLR", "recoverytest2_relation", "31", "A", "10"]
[4, "CLR", "recoverytest2_relation", "11", "A", "10"]
[5, "CLR", "recoverytest2_relation", "3", "A", "10"]
[4, "CLR", "recoverytest2_relation", "1", "A", "10"]
[5, "ABORT"]
[4, "ABORT"]
[1, "ABORT"]
[2, "ABORT"]
[3, "ABORT"]
[6, "CLR", "recoverytest2_relation", "2", "A", "10"]
[6, "ABORT"]
[7, "CLR", "recoverytest2_relation", "4", "A", "10"]
[7, "ABORT"]
[-1, "CHECKPOINT", []]
[["ID", "A"], 10, {"24": 3, "25": 3, "26": 3, "27": 3, "20": 3, "21": 3, "22": 3, "23": 3, "28": 3, "29": 3, "0": 1, "4": 1, "8": 1, "59": 6, "58": 6, "55": 6, "54": 6, "57": 6, "56": 6, "51": 6, "50": 6, "53": 6, "52": 6, "88": 9, "89": 9, "82": 9, "83": 9, "80": 9, "81": 9, "86": 9, "87": 9, "84": 9, "85": 9, "3": 1, "7": 1, "39": 4, "38": 4, "33": 4, "32": 4, "31": 4, "30": 4, "37": 4, "36": 4, "35": 4, "34": 4, "60": 7, "61": 7, "62": 7, "63": 7, "64": 7, "65": 7, "66": 7, "67": 7, "68": 7, "69": 7, "2": 1, "6": 1, "99": 10, "98": 10, "91": 10, "90": 10, "93": 10, "92": 10, "95": 10, "94": 10, "97": 10, "96": 10, "11": 2, "10": 2, "13": 2, "12": 2, "15": 2, "14": 2, "17": 2, "16": 2, "19": 2, "18": 2, "48": 5, "49": 5, "46": 5, "47": 5, "44": 5, "45": 5, "42": 5, "43": 5, "40": 5, "41": 5, "1": 1, "5": 1, "9": 1, "77": 8, "76": 8, "75": 8, "74": 8, "73": 8, "72": 8, "71": 8, "70": 8, "79": 8, "78": 8}] [["0", "10"], ["1", "10"], ["2", "10"], ["3", "10"], ["4", "10"], ["5", "10"], ["6", "10"], ["7", "10"], ["8", "10"], ["9", "10"]] [["10", "10"], ["11", "10"], ["12", "10"], ["13", "10"], ["14", "10"], ["15", "10"], ["16", "10"], ["17", "10"], ["18", "10"], ["19", "10"]] [["20", "10"], ["21", "10"], ["22", "10"], ["23", "10"], ["24", "10"], ["25", "10"], ["26", "10"], ["27", "10"], ["28", "10"], ["29", "10"]] [["30", "10"], ["31", "10"], ["32", "10"], ["33", "10"], ["34", "10"], ["35", "10"], ["36", "10"], ["37", "10"], ["38", "10"], ["39", "10"]] [["40", "10"], ["41", "10"], ["42", "10"], ["43", "10"], ["44", "10"], ["45", "10"], ["46", "10"], ["47", "10"], ["48", "10"], ["49", "10"]] [["50", "10"], ["51", "10"], ["52", "10"], ["53", "10"], ["54", "10"], ["55", "10"], ["56", "10"], ["57", "10"], ["58", "10"], ["59", "10"]] [["60", "10"], ["61", "10"], ["62", "10"], ["63", "10"], ["64", "10"], ["65", "10"], ["66", "10"], ["67", "10"], ["68", "10"], ["69", "10"]] [["70", "10"], ["71", "10"], ["72", "10"], ["73", "10"], ["74", "10"], ["75", "10"], ["76", "10"], ["77", "10"], ["78", "10"], ["79", "10"]] [["80", "10"], ["81", "10"], ["82", "10"], ["83", "10"], ["84", "10"], ["85", "10"], ["86", "10"], ["87", "10"], ["88", "10"], ["89", "10"]] [["90", "10"], ["91", "10"], ["92", "10"], ["93", "10"], ["94", "10"], ["95", "10"], ["96", "10"], ["97", "10"], ["98", "10"], ["99", "10"]]
\ No newline at end of file
[1, "START"]
[2, "START"]
[3, "START"]
[4, "START"]
[1, "UPDATE", "recoverytest3_relation", "0", "A", "10", "2"]
[2, "UPDATE", "recoverytest3_relation", "1", "A", "10", "0"]
[5, "START"]
[6, "START"]
[3, "UPDATE", "recoverytest3_relation", "2", "A", "10", "0"]
[7, "START"]
[3, "COMMIT"]
[8, "START"]
[4, "UPDATE", "recoverytest3_relation", "3", "A", "10", "5"]
[5, "UPDATE", "recoverytest3_relation", "4", "A", "10", "10"]
[4, "COMMIT"]
[9, "START"]
[6, "UPDATE", "recoverytest3_relation", "6", "A", "10", "10"]
[5, "UPDATE", "recoverytest3_relation", "14", "A", "10", "2"]
[10, "START"]
[11, "START"]
[12, "START"]
[8, "UPDATE", "recoverytest3_relation", "7", "A", "10", "9"]
[13, "START"]
[7, "UPDATE", "recoverytest3_relation", "5", "A", "10", "3"]
[9, "UPDATE", "recoverytest3_relation", "8", "A", "10", "6"]
[10, "UPDATE", "recoverytest3_relation", "9", "A", "10", "5"]
[14, "START"]
[8, "UPDATE", "recoverytest3_relation", "17", "A", "10", "6"]
[15, "START"]
[16, "START"]
[13, "UPDATE", "recoverytest3_relation", "2", "A", "0", "-1"]
[17, "START"]
[18, "START"]
[14, "UPDATE", "recoverytest3_relation", "3", "A", "5", "4"]
[19, "START"]
[20, "START"]
[6, "UPDATE", "recoverytest3_relation", "16", "A", "10", "3"]
[5, "UPDATE", "recoverytest3_relation", "24", "A", "10", "8"]
[7, "COMMIT"]
[16, "UPDATE", "recoverytest3_relation", "5", "A", "3", "0"]
[10, "CLR", "recoverytest3_relation", "9", "A", "10"]
[9, "UPDATE", "recoverytest3_relation", "18", "A", "10", "0"]
[10, "ABORT"]
[20, "UPDATE", "recoverytest3_relation", "9", "A", "10", "2"]
[1, "UPDATE", "recoverytest3_relation", "10", "A", "10", "5"]
[8, "UPDATE", "recoverytest3_relation", "27", "A", "10", "6"]
[16, "UPDATE", "recoverytest3_relation", "15", "A", "10", "2"]
[14, "UPDATE", "recoverytest3_relation", "13", "A", "10", "6"]
[2, "UPDATE", "recoverytest3_relation", "11", "A", "10", "4"]
[13, "UPDATE", "recoverytest3_relation", "12", "A", "10", "1"]
[5, "UPDATE", "recoverytest3_relation", "34", "A", "10", "7"]
[16, "UPDATE", "recoverytest3_relation", "25", "A", "10", "7"]
[16, "UPDATE", "recoverytest3_relation", "35", "A", "10", "0"]
[1, "CLR", "recoverytest3_relation", "10", "A", "10"]
[1, "CLR", "recoverytest3_relation", "0", "A", "10"]
[1, "ABORT"]
[2, "CLR", "recoverytest3_relation", "11", "A", "10"]
[2, "CLR", "recoverytest3_relation", "1", "A", "10"]
[2, "ABORT"]
[5, "CLR", "recoverytest3_relation", "34", "A", "10"]
[5, "CLR", "recoverytest3_relation", "24", "A", "10"]
[5, "CLR", "recoverytest3_relation", "14", "A", "10"]
[5, "CLR", "recoverytest3_relation", "4", "A", "10"]
[5, "ABORT"]
[6, "CLR", "recoverytest3_relation", "16", "A", "10"]
[6, "CLR", "recoverytest3_relation", "6", "A", "10"]
[6, "ABORT"]
[8, "CLR", "recoverytest3_relation", "27", "A", "10"]
[8, "CLR", "recoverytest3_relation", "17", "A", "10"]
[8, "CLR", "recoverytest3_relation", "7", "A", "10"]
[8, "ABORT"]
[9, "CLR", "recoverytest3_relation", "18", "A", "10"]
[9, "CLR", "recoverytest3_relation", "8", "A", "10"]
[9, "ABORT"]
[11, "ABORT"]
[12, "ABORT"]
[13, "CLR", "recoverytest3_relation", "12", "A", "10"]
[13, "CLR", "recoverytest3_relation", "2", "A", "0"]
[13, "ABORT"]
[14, "CLR", "recoverytest3_relation", "13", "A", "10"]
[14, "CLR", "recoverytest3_relation", "3", "A", "5"]
[14, "ABORT"]
[15, "ABORT"]
[16, "CLR", "recoverytest3_relation", "35", "A", "10"]
[16, "CLR", "recoverytest3_relation", "25", "A", "10"]
[16, "CLR", "recoverytest3_relation", "15", "A", "10"]
[16, "CLR", "recoverytest3_relation", "5", "A", "3"]
[16, "ABORT"]
[17, "ABORT"]
[18, "ABORT"]
[19, "ABORT"]
[20, "CLR", "recoverytest3_relation", "9", "A", "10"]
[20, "ABORT"]
[-1, "CHECKPOINT", []]
[["ID", "A"], 10, {"24": 3, "25": 3, "26": 3, "27": 3, "20": 3, "21": 3, "22": 3, "23": 3, "28": 3, "29": 3, "0": 1, "4": 1, "8": 1, "59": 6, "58": 6, "55": 6, "54": 6, "57": 6, "56": 6, "51": 6, "50": 6, "53": 6, "52": 6, "88": 9, "89": 9, "82": 9, "83": 9, "80": 9, "81": 9, "86": 9, "87": 9, "84": 9, "85": 9, "3": 1, "7": 1, "39": 4, "38": 4, "33": 4, "32": 4, "31": 4, "30": 4, "37": 4, "36": 4, "35": 4, "34": 4, "60": 7, "61": 7, "62": 7, "63": 7, "64": 7, "65": 7, "66": 7, "67": 7, "68": 7, "69": 7, "2": 1, "6": 1, "99": 10, "98": 10, "91": 10, "90": 10, "93": 10, "92": 10, "95": 10, "94": 10, "97": 10, "96": 10, "11": 2, "10": 2, "13": 2, "12": 2, "15": 2, "14": 2, "17": 2, "16": 2, "19": 2, "18": 2, "48": 5, "49": 5, "46": 5, "47": 5, "44": 5, "45": 5, "42": 5, "43": 5, "40": 5, "41": 5, "1": 1, "5": 1, "9": 1, "77": 8, "76": 8, "75": 8, "74": 8, "73": 8, "72": 8, "71": 8, "70": 8, "79": 8, "78": 8}] [["0", "10"], ["1", "10"], ["2", "0"], ["3", "5"], ["4", "10"], ["5", "3"], ["6", "10"], ["7", "10"], ["8", "10"], ["9", "10"]] [["10", "10"], ["11", "10"], ["12", "10"], ["13", "10"], ["14", "10"], ["15", "10"], ["16", "10"], ["17", "10"], ["18", "10"], ["19", "10"]] [["20", "10"], ["21", "10"], ["22", "10"], ["23", "10"], ["24", "10"], ["25", "10"], ["26", "10"], ["27", "10"], ["28", "10"], ["29", "10"]] [["30", "10"], ["31", "10"], ["32", "10"], ["33", "10"], ["34", "10"], ["35", "10"], ["36", "10"], ["37", "10"], ["38", "10"], ["39", "10"]] [["40", "10"], ["41", "10"], ["42", "10"], ["43", "10"], ["44", "10"], ["45", "10"], ["46", "10"], ["47", "10"], ["48", "10"], ["49", "10"]] [["50", "10"], ["51", "10"], ["52", "10"], ["53", "10"], ["54", "10"], ["55", "10"], ["56", "10"], ["57", "10"], ["58", "10"], ["59", "10"]] [["60", "10"], ["61", "10"], ["62", "10"], ["63", "10"], ["64", "10"], ["65", "10"], ["66", "10"], ["67", "10"], ["68", "10"], ["69", "10"]] [["70", "10"], ["71", "10"], ["72", "10"], ["73", "10"], ["74", "10"], ["75", "10"], ["76", "10"], ["77", "10"], ["78", "10"], ["79", "10"]] [["80", "10"], ["81", "10"], ["82", "10"], ["83", "10"], ["84", "10"], ["85", "10"], ["86", "10"], ["87", "10"], ["88", "10"], ["89", "10"]] [["90", "10"], ["91", "10"], ["92", "10"], ["93", "10"], ["94", "10"], ["95", "10"], ["96", "10"], ["97", "10"], ["98", "10"], ["99", "10"]]
\ No newline at end of file
[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"]
[["ID", "A"], 10, {"24": 3, "25": 3, "26": 3, "27": 3, "20": 3, "21": 3, "22": 3, "23": 3, "28": 3, "29": 3, "0": 1, "4": 1, "8": 1, "59": 6, "58": 6, "55": 6, "54": 6, "57": 6, "56": 6, "51": 6, "50": 6, "53": 6, "52": 6, "88": 9, "89": 9, "82": 9, "83": 9, "80": 9, "81": 9, "86": 9, "87": 9, "84": 9, "85": 9, "3": 1, "7": 1, "39": 4, "38": 4, "33": 4, "32": 4, "31": 4, "30": 4, "37": 4, "36": 4, "35": 4, "34": 4, "60": 7, "61": 7, "62": 7, "63": 7, "64": 7, "65": 7, "66": 7, "67": 7, "68": 7, "69": 7, "2": 1, "6": 1, "99": 10, "98": 10, "91": 10, "90": 10, "93": 10, "92": 10, "95": 10, "94": 10, "97": 10, "96": 10, "11": 2, "10": 2, "13": 2, "12": 2, "15": 2, "14": 2, "17": 2, "16": 2, "19": 2, "18": 2, "48": 5, "49": 5, "46": 5, "47": 5, "44": 5, "45": 5, "42": 5, "43": 5, "40": 5, "41": 5, "1": 1, "5": 1, "9": 1, "77": 8, "76": 8, "75": 8, "74": 8, "73": 8, "72": 8, "71": 8, "70": 8, "79": 8, "78": 8}] [["0", "10"], ["1", "10"], ["2", "10"], ["3", "10"], ["4", "10"], ["5", "10"], ["6", "10"], ["7", "10"], ["8", "10"], ["9", "10"]] [["10", "10"], ["11", "10"], ["12", "10"], ["13", "10"], ["14", "10"], ["15", "10"], ["16", "10"], ["17", "10"], ["18", "10"], ["19", "10"]] [["20", "10"], ["21", "10"], ["22", "10"], ["23", "10"], ["24", "10"], ["25", "10"], ["26", "10"], ["27", "10"], ["28", "10"], ["29", "10"]] [["30", "10"], ["31", "10"], ["32", "10"], ["33", "10"], ["34", "10"], ["35", "10"], ["36", "10"], ["37", "10"], ["38", "10"], ["39", "10"]] [["40", "10"], ["41", "10"], ["42", "10"], ["43", "10"], ["44", "10"], ["45", "10"], ["46", "10"], ["47", "10"], ["48", "10"], ["49", "10"]] [["50", "10"], ["51", "10"], ["52", "10"], ["53", "10"], ["54", "10"], ["55", "10"], ["56", "10"], ["57", "10"], ["58", "10"], ["59", "10"]] [["60", "10"], ["61", "10"], ["62", "10"], ["63", "10"], ["64", "10"], ["65", "10"], ["66", "10"], ["67", "10"], ["68", "10"], ["69", "10"]] [["70", "10"], ["71", "10"], ["72", "10"], ["73", "10"], ["74", "10"], ["75", "10"], ["76", "10"], ["77", "10"], ["78", "10"], ["79", "10"]] [["80", "10"], ["81", "10"], ["82", "10"], ["83", "10"], ["84", "10"], ["85", "10"], ["86", "10"], ["87", "10"], ["88", "10"], ["89", "10"]] [["90", "10"], ["91", "10"], ["92", "10"], ["93", "10"], ["94", "10"], ["95", "10"], ["96", "10"], ["97", "10"], ["98", "10"], ["99", "10"]]
\ No newline at end of file
[1, "START"]
[2, "START"]
[3, "START"]
[4, "START"]
[5, "START"]
[6, "START"]
[7, "START"]
[6, "UPDATE", "recoverytest2_relation", "2", "A", "10", "0"]
[7, "UPDATE", "recoverytest2_relation", "4", "A", "10", "0"]
[4, "UPDATE", "recoverytest2_relation", "1", "A", "10", "7"]
[5, "UPDATE", "recoverytest2_relation", "3", "A", "10", "7"]
[4, "UPDATE", "recoverytest2_relation", "11", "A", "10", "13"]
[5, "UPDATE", "recoverytest2_relation", "31", "A", "10", "13"]
[5, "CLR", "recoverytest2_relation", "31", "A", "10"]
[4, "CLR", "recoverytest2_relation", "11", "A", "10"]
[5, "CLR", "recoverytest2_relation", "3", "A", "10"]
[4, "CLR", "recoverytest2_relation", "1", "A", "10"]
[5, "ABORT"]
[4, "ABORT"]
[["ID", "A"], 10, {"24": 3, "25": 3, "26": 3, "27": 3, "20": 3, "21": 3, "22": 3, "23": 3, "28": 3, "29": 3, "0": 1, "4": 1, "8": 1, "59": 6, "58": 6, "55": 6, "54": 6, "57": 6, "56": 6, "51": 6, "50": 6, "53": 6, "52": 6, "88": 9, "89": 9, "82": 9, "83": 9, "80": 9, "81": 9, "86": 9, "87": 9, "84": 9, "85": 9, "3": 1, "7": 1, "39": 4, "38": 4, "33": 4, "32": 4, "31": 4, "30": 4, "37": 4, "36": 4, "35": 4, "34": 4, "60": 7, "61": 7, "62": 7, "63": 7, "64": 7, "65": 7, "66": 7, "67": 7, "68": 7, "69": 7, "2": 1, "6": 1, "99": 10, "98": 10, "91": 10, "90": 10, "93": 10, "92": 10, "95": 10, "94": 10, "97": 10, "96": 10, "11": 2, "10": 2, "13": 2, "12": 2, "15": 2, "14": 2, "17": 2, "16": 2, "19": 2, "18": 2, "48": 5, "49": 5, "46": 5, "47": 5, "44": 5, "45": 5, "42": 5, "43": 5, "40": 5, "41": 5, "1": 1, "5": 1, "9": 1, "77": 8, "76": 8, "75": 8, "74": 8, "73": 8, "72": 8, "71": 8, "70": 8, "79": 8, "78": 8}] [["0", "10"], ["1", "10"], ["2", "10"], ["3", "10"], ["4", "10"], ["5", "10"], ["6", "10"], ["7", "10"], ["8", "10"], ["9", "10"]] [["10", "10"], ["11", "10"], ["12", "10"], ["13", "10"], ["14", "10"], ["15", "10"], ["16", "10"], ["17", "10"], ["18", "10"], ["19", "10"]] [["20", "10"], ["21", "10"], ["22", "10"], ["23", "10"], ["24", "10"], ["25", "10"], ["26", "10"], ["27", "10"], ["28", "10"], ["29", "10"]] [["30", "10"], ["31", "10"], ["32", "10"], ["33", "10"], ["34", "10"], ["35", "10"], ["36", "10"], ["37", "10"], ["38", "10"], ["39", "10"]] [["40", "10"], ["41", "10"], ["42", "10"], ["43", "10"], ["44", "10"], ["45", "10"], ["46", "10"], ["47", "10"], ["48", "10"], ["49", "10"]] [["50", "10"], ["51", "10"], ["52", "10"], ["53", "10"], ["54", "10"], ["55", "10"], ["56", "10"], ["57", "10"], ["58", "10"], ["59", "10"]] [["60", "10"], ["61", "10"], ["62", "10"], ["63", "10"], ["64", "10"], ["65", "10"], ["66", "10"], ["67", "10"], ["68", "10"], ["69", "10"]] [["70", "10"], ["71", "10"], ["72", "10"], ["73", "10"], ["74", "10"], ["75", "10"], ["76", "10"], ["77", "10"], ["78", "10"], ["79", "10"]] [["80", "10"], ["81", "10"], ["82", "10"], ["83", "10"], ["84", "10"], ["85", "10"], ["86", "10"], ["87", "10"], ["88", "10"], ["89", "10"]] [["90", "10"], ["91", "10"], ["92", "10"], ["93", "10"], ["94", "10"], ["95", "10"], ["96", "10"], ["97", "10"], ["98", "10"], ["99", "10"]]
\ No newline at end of file
[1, "START"]
[2, "START"]
[3, "START"]
[4, "START"]
[1, "UPDATE", "recoverytest3_relation", "0", "A", "10", "2"]
[2, "UPDATE", "recoverytest3_relation", "1", "A", "10", "0"]
[5, "START"]
[6, "START"]
[3, "UPDATE", "recoverytest3_relation", "2", "A", "10", "0"]
[7, "START"]
[3, "COMMIT"]
[8, "START"]
[4, "UPDATE", "recoverytest3_relation", "3", "A", "10", "5"]
[5, "UPDATE", "recoverytest3_relation", "4", "A", "10", "10"]
[4, "COMMIT"]
[9, "START"]
[6, "UPDATE", "recoverytest3_relation", "6", "A", "10", "10"]
[5, "UPDATE", "recoverytest3_relation", "14", "A", "10", "2"]
[10, "START"]
[11, "START"]
[12, "START"]
[8, "UPDATE", "recoverytest3_relation", "7", "A", "10", "9"]
[13, "START"]
[7, "UPDATE", "recoverytest3_relation", "5", "A", "10", "3"]
[9, "UPDATE", "recoverytest3_relation", "8", "A", "10", "6"]
[10, "UPDATE", "recoverytest3_relation", "9", "A", "10", "5"]
[14, "START"]
[8, "UPDATE", "recoverytest3_relation", "17", "A", "10", "6"]
[15, "START"]
[16, "START"]
[13, "UPDATE", "recoverytest3_relation", "2", "A", "0", "-1"]
[17, "START"]
[18, "START"]
[14, "UPDATE", "recoverytest3_relation", "3", "A", "5", "4"]
[19, "START"]
[20, "START"]
[6, "UPDATE", "recoverytest3_relation", "16", "A", "10", "3"]
[5, "UPDATE", "recoverytest3_relation", "24", "A", "10", "8"]
[7, "COMMIT"]
[16, "UPDATE", "recoverytest3_relation", "5", "A", "3", "0"]
[10, "CLR", "recoverytest3_relation", "9", "A", "10"]
[9, "UPDATE", "recoverytest3_relation", "18", "A", "10", "0"]
[10, "ABORT"]
[20, "UPDATE", "recoverytest3_relation", "9", "A", "10", "2"]
[1, "UPDATE", "recoverytest3_relation", "10", "A", "10", "5"]
[8, "UPDATE", "recoverytest3_relation", "27", "A", "10", "6"]
[16, "UPDATE", "recoverytest3_relation", "15", "A", "10", "2"]
[14, "UPDATE", "recoverytest3_relation", "13", "A", "10", "6"]
[2, "UPDATE", "recoverytest3_relation", "11", "A", "10", "4"]
[13, "UPDATE", "recoverytest3_relation", "12", "A", "10", "1"]
[5, "UPDATE", "recoverytest3_relation", "34", "A", "10", "7"]
[16, "UPDATE", "recoverytest3_relation", "25", "A", "10", "7"]
[16, "UPDATE", "recoverytest3_relation", "35", "A", "10", "0"]
[["ID", "A"], 10, {"24": 3, "25": 3, "26": 3, "27": 3, "20": 3, "21": 3, "22": 3, "23": 3, "28": 3, "29": 3, "0": 1, "4": 1, "8": 1, "59": 6, "58": 6, "55": 6, "54": 6, "57": 6, "56": 6, "51": 6, "50": 6, "53": 6, "52": 6, "88": 9, "89": 9, "82": 9, "83": 9, "80": 9, "81": 9, "86": 9, "87": 9, "84": 9, "85": 9, "3": 1, "7": 1, "39": 4, "38": 4, "33": 4, "32": 4, "31": 4, "30": 4, "37": 4, "36": 4, "35": 4, "34": 4, "60": 7, "61": 7, "62": 7, "63": 7, "64": 7, "65": 7, "66": 7, "67": 7, "68": 7, "69": 7, "2": 1, "6": 1, "99": 10, "98": 10, "91": 10, "90": 10, "93": 10, "92": 10, "95": 10, "94": 10, "97": 10, "96": 10, "11": 2, "10": 2, "13": 2, "12": 2, "15": 2, "14": 2, "17": 2, "16": 2, "19": 2, "18": 2, "48": 5, "49": 5, "46": 5, "47": 5, "44": 5, "45": 5, "42": 5, "43": 5, "40": 5, "41": 5, "1": 1, "5": 1, "9": 1, "77": 8, "76": 8, "75": 8, "74": 8, "73": 8, "72": 8, "71": 8, "70": 8, "79": 8, "78": 8}] [["0", "10"], ["1", "10"], ["2", "10"], ["3", "10"], ["4", "10"], ["5", "10"], ["6", "10"], ["7", "10"], ["8", "10"], ["9", "10"]] [["10", "10"], ["11", "10"], ["12", "10"], ["13", "10"], ["14", "10"], ["15", "10"], ["16", "10"], ["17", "10"], ["18", "10"], ["19", "10"]] [["20", "10"], ["21", "10"], ["22", "10"], ["23", "10"], ["24", "10"], ["25", "10"], ["26", "10"], ["27", "10"], ["28", "10"], ["29", "10"]] [["30", "10"], ["31", "10"], ["32", "10"], ["33", "10"], ["34", "10"], ["35", "10"], ["36", "10"], ["37", "10"], ["38", "10"], ["39", "10"]] [["40", "10"], ["41", "10"], ["42", "10"], ["43", "10"], ["44", "10"], ["45", "10"], ["46", "10"], ["47", "10"], ["48", "10"], ["49", "10"]] [["50", "10"], ["51", "10"], ["52", "10"], ["53", "10"], ["54", "10"], ["55", "10"], ["56", "10"], ["57", "10"], ["58", "10"], ["59", "10"]] [["60", "10"], ["61", "10"], ["62", "10"], ["63", "10"], ["64", "10"], ["65", "10"], ["66", "10"], ["67", "10"], ["68", "10"], ["69", "10"]] [["70", "10"], ["71", "10"], ["72", "10"], ["73", "10"], ["74", "10"], ["75", "10"], ["76", "10"], ["77", "10"], ["78", "10"], ["79", "10"]] [["80", "10"], ["81", "10"], ["82", "10"], ["83", "10"], ["84", "10"], ["85", "10"], ["86", "10"], ["87", "10"], ["88", "10"], ["89", "10"]] [["90", "10"], ["91", "10"], ["92", "10"], ["93", "10"], ["94", "10"], ["95", "10"], ["96", "10"], ["97", "10"], ["98", "10"], ["99", "10"]]
\ No newline at end of file
......@@ -10,6 +10,7 @@ from exampletransactions import *
#####################################################################################################
# Initial Setup
print("Reading from '{}' and '{}\n".format("logfile", "relation1"))
bpool = BufferPool()
r = Relation('relation1')
LogManager.setAndAnalyzeLogFile('logfile')
......
......@@ -169,8 +169,10 @@ class LogManager:
# - fix by:
# - reverting transactions that did not finish by calling `revertChanges` on them
# - redo transactions that did finish by calling `redoChanges`
# - telling the buffer manager to write all changes to disk
# After the restart recovery is done,we can now write out a CHECKPOINT record to signify
# After the restart recovery is done (i.e., 'revertChanges' called on aborted or not finished transactions,
# 'redoChanges' called on
# undone, and all the pages have been written to disk), we can now write out a CHECKPOINT record to signify
# that the file contents are in a consistent state
lr = LogRecord([-1, LogRecord.CHECKPOINT, list()])
LogManager.writeLogRecord(lr)
......
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