diff --git a/assets/ostep_1681115599584_0.edn b/assets/ostep_1681115599584_0.edn index 1935f66..6258fed 100644 --- a/assets/ostep_1681115599584_0.edn +++ b/assets/ostep_1681115599584_0.edn @@ -5600,5 +5600,1083 @@ :height 1382.4}), :page 558}, :content {:text "Crash Consistency"}, - :properties {:color "yellow"}}], - :extra {:page 558}} + :properties {:color "yellow"}} + {:id #uuid "643b7d72-4da5-42cf-abd5-dbbc3d9332d7", + :page 560, + :position {:bounding {:x1 139.3125, + :y1 1230.03125, + :x2 313.9190673828125, + :y2 1254.03125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 139.3125, + :y1 1230.03125, + :x2 313.9190673828125, + :y2 1254.03125, + :width 1036.8, + :height 1555.2}), + :page 560}, + :content {:text "Crash Scenarios"}, + :properties {:color "yellow"}} + {:id #uuid "643b8161-a7b8-496d-9121-4ce20ee8deb6", + :page 562, + :position {:bounding {:x1 282.4173889160156, + :y1 537.546875, + :x2 568.6414184570312, + :y2 563.546875, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 282.4173889160156, + :y1 537.546875, + :x2 568.6414184570312, + :y2 563.546875, + :width 1036.8, + :height 1555.2}), + :page 562}, + :content {:text " The File System Checker"}, + :properties {:color "yellow"}} + {:id #uuid "643b81ae-edfd-4a9e-9df2-fdba2175dde2", + :page 562, + :position {:bounding {:x1 0, + :y1 332, + :x2 830.3247680664062, + :y2 792.984375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 0, + :y1 332, + :x2 0, + :y2 356, + :width 1036.8, + :height 1555.2} + {:x1 650.4619140625, + :y1 748.078125, + :x2 830.3247680664062, + :y2 769.078125, + :width 1036.8, + :height 1555.2} + {:x1 139.3125, + :y1 771.984375, + :x2 742.9141845703125, + :y2 792.984375, + :width 1036.8, + :height 1555.2}), + :page 562}, + :content {:text " The only real goal is to make sure the file system metadata is internally consistent."}, + :properties {:color "yellow"}} + {:id #uuid "643b824d-2732-46ae-961d-74a06db18138", + :page 563, + :position {:bounding {:x1 519.442626953125, + :y1 1223.109375, + :x2 597.9298706054688, + :y2 1244.109375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 519.442626953125, + :y1 1223.109375, + :x2 597.9298706054688, + :y2 1244.109375, + :width 1036.8, + :height 1555.2}), + :page 563}, + :content {:text "premise "}, + :properties {:color "green"}} + {:id #uuid "643b824f-c588-4b82-93e6-393016d3b5b1", + :page 563, + :position {:bounding {:x1 811.2379150390625, + :y1 1223.109375, + :x2 849.494873046875, + :y2 1244.109375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 811.2379150390625, + :y1 1223.109375, + :x2 849.494873046875, + :y2 1244.109375, + :width 1036.8, + :height 1555.2}), + :page 563}, + :content {:text "tad "}, + :properties {:color "green"}} + {:id #uuid "643b86d9-afcc-4494-87d1-275502df79a7", + :page 564, + :position {:bounding {:x1 283.0144958496094, + :y1 335.515625, + :x2 714.134765625, + :y2 361.515625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 283.0144958496094, + :y1 335.515625, + :x2 714.134765625, + :y2 361.515625, + :width 1036.8, + :height 1555.2}), + :page 564}, + :content {:text " Journaling (or Write-Ahead Logging)"}, + :properties {:color "yellow"}} + {:id #uuid "643b8dad-3813-4048-8d04-5eb93a6bd182", + :page 579, + :position {:bounding {:x1 401.21875, + :y1 427.703125, + :x2 830.3309936523438, + :y2 462.703125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 401.21875, + :y1 427.703125, + :x2 830.3309936523438, + :y2 462.703125, + :width 1036.8, + :height 1555.2}), + :page 579}, + :content {:text "Log-structured File Systems"}, + :properties {:color "yellow"}} + {:id #uuid "643b8dc6-e380-49e3-ab08-ce27aa8767e2", + :page 565, + :position {:bounding {:x1 206.265625, + :y1 215.78125, + :x2 380.91510009765625, + :y2 239.78125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 206.265625, + :y1 215.78125, + :x2 380.91510009765625, + :y2 239.78125, + :width 1036.8, + :height 1555.2}), + :page 565}, + :content {:text "Data Journaling"}, + :properties {:color "yellow"}} + {:id #uuid "643b8ebd-b694-4862-90f0-9fb0f1a847f5", + :page 565, + :position {:bounding {:x1 373.28125, + :y1 660, + :x2 538.6414184570312, + :y2 681, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 373.28125, + :y1 660, + :x2 538.6414184570312, + :y2 681, + :width 1036.8, + :height 1555.2}), + :page 565}, + :content {:text "physical logging"}, + :properties {:color "yellow"}} + {:id #uuid "643b8eed-3b37-4ac0-b924-9a2d035f2517", + :page 565, + :position {:bounding {:x1 750.84375, + :y1 851.265625, + :x2 891.925048828125, + :y2 872.265625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 750.84375, + :y1 851.265625, + :x2 891.925048828125, + :y2 872.265625, + :width 1036.8, + :height 1555.2}), + :page 565}, + :content {:text "checkpointing"}, + :properties {:color "yellow"}} + {:id #uuid "643b8f7d-76a2-477e-89ea-1321475b3dbe", + :page 565, + :position {:bounding {:x1 531.5922241210938, + :y1 612.171875, + :x2 737.2514038085938, + :y2 633.6875, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 531.5922241210938, + :y1 612.171875, + :x2 737.2514038085938, + :y2 633.6875, + :width 1036.8, + :height 1555.2}), + :page 565}, + :content {:text "transaction identifier"}, + :properties {:color "yellow"}} + {:id #uuid "643b9301-4a07-459a-a413-5c2738560e10", + :page 568, + :position {:bounding {:x1 139.3125, + :y1 537.390625, + :x2 240.23863220214844, + :y2 561.390625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 139.3125, + :y1 537.390625, + :x2 240.23863220214844, + :y2 561.390625, + :width 1036.8, + :height 1555.2}), + :page 568}, + :content {:text "Recovery"}, + :properties {:color "yellow"}} + {:id #uuid "643b96ec-18c9-4053-be7e-3b7d3b7dbbbd", + :page 570, + :position {:bounding {:x1 139.3125, + :y1 942.078125, + :x2 364.4480285644531, + :y2 966.078125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 139.3125, + :y1 942.078125, + :x2 364.4480285644531, + :y2 966.078125, + :width 1036.8, + :height 1555.2}), + :page 570}, + :content {:text "Metadata Journaling"}, + :properties {:color "yellow"}} + {:id #uuid "643b9816-e478-4f45-a5bd-fbe168fdc406", + :page 567, + :position {:bounding {:x1 461.0518798828125, + :y1 234.015625, + :x2 713.3812866210938, + :y2 255.53125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 461.0518798828125, + :y1 234.015625, + :x2 649.8125, + :y2 255.53125, + :width 1036.8, + :height 1555.2} + {:x1 661.640625, + :y1 237.75, + :x2 713.3812866210938, + :y2 254.75, + :width 1036.8, + :height 1555.2}), + :page 567}, + :content {:text " OPTIMIZING LOG WRITES"}, + :properties {:color "yellow"}} + {:id #uuid "643b9b7c-a43e-4c50-9dec-1d8f30bae712", + :page 571, + :position {:bounding {:x1 0, + :y1 460, + :x2 897.3082275390625, + :y2 1205.15625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 0, + :y1 460, + :x2 0, + :y2 484, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 476, + :x2 0, + :y2 500, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 492, + :x2 0, + :y2 516, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 508, + :x2 0, + :y2 532, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 524, + :x2 0, + :y2 548, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 540, + :x2 0, + :y2 564, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 556, + :x2 0, + :y2 580, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 572, + :x2 0, + :y2 596, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 588, + :x2 0, + :y2 612, + :width 1036.8, + :height 1555.2} + {:x1 234.34375, + :y1 968.46875, + :x2 827.692138671875, + :y2 989.984375, + :width 1036.8, + :height 1555.2} + {:x1 261.5625, + :y1 992.375, + :x2 668.9840087890625, + :y2 1013.890625, + :width 1036.8, + :height 1555.2} + {:x1 234.34375, + :y1 1016.28125, + :x2 897.2957153320312, + :y2 1037.796875, + :width 1036.8, + :height 1555.2} + {:x1 261.5625, + :y1 1040.203125, + :x2 563.6427001953125, + :y2 1061.71875, + :width 1036.8, + :height 1555.2} + {:x1 234.34375, + :y1 1064.109375, + :x2 897.3043212890625, + :y2 1085.625, + :width 1036.8, + :height 1555.2} + {:x1 261.5625, + :y1 1088, + :x2 897.30126953125, + :y2 1109.515625, + :width 1036.8, + :height 1555.2} + {:x1 261.5625, + :y1 1111.90625, + :x2 578.203125, + :y2 1133.421875, + :width 1036.8, + :height 1555.2} + {:x1 234.34375, + :y1 1135.8125, + :x2 897.3082275390625, + :y2 1157.328125, + :width 1036.8, + :height 1555.2} + {:x1 261.5625, + :y1 1159.734375, + :x2 684.023681640625, + :y2 1181.25, + :width 1036.8, + :height 1555.2} + {:x1 234.34375, + :y1 1183.640625, + :x2 825.650390625, + :y2 1205.15625, + :width 1036.8, + :height 1555.2}), + :page 571}, + :content {:text "1. Data write: Write data to final location; wait for completion(the wait is optional; see below for details).2. Journal metadata write: Write the begin block and metadata to the log; wait for writes to complete.3. Journal commit: Write the transaction commit block (containing TxE) to the log; wait for the write to complete; the transaction (including data) is now committed.4. Checkpoint metadata: Write the contents of the metadata update to their final locations within the file system.5. Free: Later, mark the transaction free in journal superblock."}, + :properties {:color "yellow"}} + {:id #uuid "643b9c40-6329-4720-9d26-75a78701392c", + :page 572, + :position {:bounding {:x1 304.4091796875, + :y1 663.640625, + :x2 367.1739196777344, + :y2 682.640625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 304.4091796875, + :y1 663.640625, + :x2 367.1739196777344, + :y2 682.640625, + :width 1036.8, + :height 1555.2}), + :page 572}, + :content {:text "hideous "}, + :properties {:color "green"}} + {:id #uuid "643b9c49-9e7c-4379-a640-8aff152ea511", + :page 572, + :position {:bounding {:x1 459.9234313964844, + :y1 686.359375, + :x2 501.405029296875, + :y2 705.359375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 459.9234313964844, + :y1 686.359375, + :x2 501.405029296875, + :y2 705.359375, + :width 1036.8, + :height 1555.2}), + :page 572}, + :content {:text "hairy"}, + :properties {:color "green"}} + {:id #uuid "643b9c5a-c06b-4a4b-af75-9a2242069fc8", + :page 572, + :position {:bounding {:x1 139.3125, + :y1 539.265625, + :x2 414.3367614746094, + :y2 563.265625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 139.3125, + :y1 539.265625, + :x2 414.3367614746094, + :y2 563.265625, + :width 1036.8, + :height 1555.2}), + :page 572}, + :content {:text "Tricky Case: Block Reuse"}, + :properties {:color "yellow"}} + {:id #uuid "643b9e00-4597-4a1a-890a-be95041f6b3b", + :page 570, + :position {:bounding {:x1 0, + :y1 172, + :x2 830.3529052734375, + :y2 785.109375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 0, + :y1 172, + :x2 0, + :y2 196, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 188, + :x2 0, + :y2 212, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 204, + :x2 0, + :y2 228, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 220, + :x2 0, + :y2 244, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 236, + :x2 0, + :y2 260, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 252, + :x2 0, + :y2 276, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 268, + :x2 0, + :y2 292, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 284, + :x2 0, + :y2 308, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 300, + :x2 0, + :y2 324, + :width 1036.8, + :height 1555.2} + {:x1 167.40625, + :y1 548.921875, + :x2 830.33740234375, + :y2 570.4375, + :width 1036.8, + :height 1555.2} + {:x1 194.609375, + :y1 572.828125, + :x2 830.3390502929688, + :y2 594.34375, + :width 1036.8, + :height 1555.2} + {:x1 194.609375, + :y1 596.75, + :x2 287.1246337890625, + :y2 618.265625, + :width 1036.8, + :height 1555.2} + {:x1 167.40625, + :y1 620.65625, + :x2 830.3453369140625, + :y2 642.171875, + :width 1036.8, + :height 1555.2} + {:x1 194.609375, + :y1 644.546875, + :x2 830.3316040039062, + :y2 666.0625, + :width 1036.8, + :height 1555.2} + {:x1 194.609375, + :y1 668.453125, + :x2 358.1875, + :y2 689.96875, + :width 1036.8, + :height 1555.2} + {:x1 167.40625, + :y1 692.375, + :x2 830.3278198242188, + :y2 713.890625, + :width 1036.8, + :height 1555.2} + {:x1 194.609375, + :y1 716.28125, + :x2 404.6365966796875, + :y2 737.796875, + :width 1036.8, + :height 1555.2} + {:x1 167.40625, + :y1 740.1875, + :x2 830.3529052734375, + :y2 761.703125, + :width 1036.8, + :height 1555.2} + {:x1 194.609375, + :y1 764.109375, + :x2 506.65380859375, + :y2 785.109375, + :width 1036.8, + :height 1555.2}), + :page 570}, + :content {:text "1. Journal write: Write the contents of the transaction (containing TxB and the contents of the update) to the log; wait for these writes to complete.2. Journal commit: Write the transaction commit block (containing TxE) to the log; wait for the write to complete; the transaction is now committed.3. Checkpoint: Write the contents of the update to their final locations within the file system.4. Free: Some time later, mark the transaction free in the journal by updating the journal superblock."}, + :properties {:color "yellow"}} + {:id #uuid "643ba14d-00f4-4f92-921c-740f3b6def61", + :page 574, + :position {:bounding {:x1 287.40380859375, + :y1 786.0625, + :x2 497.21820068359375, + :y2 812.0625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 287.40380859375, + :y1 786.0625, + :x2 497.21820068359375, + :y2 812.0625, + :width 1036.8, + :height 1555.2}), + :page 574}, + :content {:text " Other Approaches"}, + :properties {:color "yellow"}} + {:id #uuid "643ba369-83df-42f9-9ee9-b45d4652e8fb", + :page 595, + :position {:bounding {:x1 543.3125, + :y1 413.453125, + :x2 830.31494140625, + :y2 458.453125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 543.3125, + :y1 413.453125, + :x2 830.31494140625, + :y2 458.453125, + :width 1036.8, + :height 1555.2}), + :page 595}, + :content {:text "Flash-based SSDs"}, + :properties {:color "yellow"}} + {:id #uuid "643ba392-acd9-4255-930e-a97f94fb28ef", + :page 619, + :position {:bounding {:x1 393.828125, + :y1 422.234375, + :x2 830.310791015625, + :y2 467.234375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 393.828125, + :y1 422.234375, + :x2 830.310791015625, + :y2 467.234375, + :width 1036.8, + :height 1555.2}), + :page 619}, + :content {:text "Data Integrity and Protection"}, + :properties {:color "yellow"}} + {:id #uuid "643ba3b2-5a2a-4589-a871-62ad213de195", + :page 633, + :position {:bounding {:x1 371.72705078125, + :y1 589.078125, + :x2 431.62933349609375, + :y2 610.078125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 371.72705078125, + :y1 589.078125, + :x2 431.62933349609375, + :y2 610.078125, + :width 1036.8, + :height 1555.2}), + :page 633}, + :content {:text "spouse "}, + :properties {:color "green"}} + {:id #uuid "643bab9f-04f5-4e2f-b232-d6cfead45619", + :page 580, + :position {:bounding {:x1 206.265625, + :y1 1049.65625, + :x2 539.10986328125, + :y2 1075.65625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 206.265625, + :y1 1049.65625, + :x2 539.10986328125, + :y2 1075.65625, + :width 1036.8, + :height 1555.2}), + :page 580}, + :content {:text "Writing To Disk Sequentially"}, + :properties {:color "yellow"}} + {:id #uuid "643bac5e-ce70-4d9b-92c5-4fb6dda099d6", + :page 581, + :position {:bounding {:x1 139.3125, + :y1 695.5, + :x2 565.12255859375, + :y2 721.5, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 139.3125, + :y1 695.5, + :x2 565.12255859375, + :y2 721.5, + :width 1036.8, + :height 1555.2}), + :page 581}, + :content {:text "Writing Sequentially And Effectively"}, + :properties {:color "yellow"}} + {:id #uuid "643bac81-cd5a-49aa-a81b-aff6c2405a40", + :page 581, + :position {:bounding {:x1 0, + :y1 476, + :x2 830.3544311523438, + :y2 1106.125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 0, + :y1 476, + :x2 0, + :y2 500, + :width 1036.8, + :height 1555.2} + {:x1 778.9252319335938, + :y1 1057.515625, + :x2 830.3544311523438, + :y2 1078.515625, + :width 1036.8, + :height 1555.2} + {:x1 139.3125, + :y1 1085.125, + :x2 233.4244384765625, + :y2 1106.125, + :width 1036.8, + :height 1555.2}), + :page 581}, + :content {:text "write buffering"}, + :properties {:color "yellow"}} + {:id #uuid "643bb0bc-9781-484e-b249-224d89414165", + :page 582, + :position {:bounding {:x1 206.265625, + :y1 623.65625, + :x2 462.4770202636719, + :y2 649.65625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 206.265625, + :y1 623.65625, + :x2 462.4770202636719, + :y2 649.65625, + :width 1036.8, + :height 1555.2}), + :page 582}, + :content {:text "How Much To Buffer?"}, + :properties {:color "yellow"}} + {:id #uuid "643bb0f6-b84c-469e-8188-0db6e86f36e8", + :page 583, + :position {:bounding {:x1 497.2579650878906, + :y1 1198.859375, + :x2 670.0648193359375, + :y2 1224.859375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 497.2579650878906, + :y1 1198.859375, + :x2 670.0648193359375, + :y2 1224.859375, + :width 1036.8, + :height 1555.2}), + :page 583}, + :content {:text " The Inode Map"}, + :properties {:color "yellow"}} + {:id #uuid "643bb162-9f99-4740-8fd6-859f236c1855", + :page 583, + :position {:bounding {:x1 0, + :y1 684, + :x2 830.3582153320312, + :y2 1339.734375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 0, + :y1 684, + :x2 0, + :y2 708, + :width 1036.8, + :height 1555.2} + {:x1 364.13922119140625, + :y1 1294.8125, + :x2 830.3500366210938, + :y2 1315.8125, + :width 1036.8, + :height 1555.2} + {:x1 139.3125, + :y1 1318.734375, + :x2 830.3582153320312, + :y2 1339.734375, + :width 1036.8, + :height 1555.2}), + :page 583}, + :content {:text "The imap is a structure that takes an inode number as input and produces the disk address of the most recent version of the"}, + :properties {:color "yellow"}} + {:id #uuid "643bb250-205a-4ae9-8cff-0d715cfa6b7d", + :page 585, + :position {:bounding {:x1 441.48602294921875, + :y1 214.8125, + :x2 718.4859619140625, + :y2 240.8125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 441.48602294921875, + :y1 214.8125, + :x2 718.4859619140625, + :y2 240.8125, + :width 1036.8, + :height 1555.2}), + :page 585}, + :content {:text " The Checkpoint Region"}, + :properties {:color "yellow"}} + {:id #uuid "643bb2dd-2247-436a-b6b7-c1702b426e43", + :page 585, + :position {:bounding {:x1 0, + :y1 108, + :x2 830.3558959960938, + :y2 500.84375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 0, + :y1 108, + :x2 0, + :y2 132, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 124, + :x2 0, + :y2 148, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 140, + :x2 0, + :y2 164, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 156, + :x2 0, + :y2 180, + :width 1036.8, + :height 1555.2} + {:x1 549.5653686523438, + :y1 384.203125, + :x2 830.3291625976562, + :y2 405.203125, + :width 1036.8, + :height 1555.2} + {:x1 139.3125, + :y1 408.109375, + :x2 830.3436279296875, + :y2 429.625, + :width 1036.8, + :height 1555.2} + {:x1 139.3125, + :y1 432.03125, + :x2 830.3397827148438, + :y2 453.546875, + :width 1036.8, + :height 1555.2} + {:x1 139.3125, + :y1 455.9375, + :x2 830.3558959960938, + :y2 477.453125, + :width 1036.8, + :height 1555.2} + {:x1 139.3125, + :y1 479.84375, + :x2 375.723876953125, + :y2 500.84375, + :width 1036.8, + :height 1555.2}), + :page 585}, + :content {:text "ontains pointers to (i.e., addresses of) the latest pieces of the inode map, and thus the inode map pieces can be found by reading the CR first. Note the checkpoint region is only updated periodically (say every 30 seconds or so), and thus performance is not ill-affected."}, + :properties {:color "yellow"}} + {:id #uuid "643bb439-b7d0-4170-9417-cd900062bfbd", + :page 586, + :position {:bounding {:x1 818.3013305664062, + :y1 1073.046875, + :x2 897.2958374023438, + :y2 1094.046875, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 818.3013305664062, + :y1 1073.046875, + :x2 897.2958374023438, + :y2 1094.046875, + :width 1036.8, + :height 1555.2}), + :page 586}, + :content {:text "mandated"}, + :properties {:color "green"}} + {:id #uuid "643bb4de-bc1f-4f61-a5dd-036867e85fe7", + :page 586, + :position {:bounding {:x1 350.953125, + :y1 953.5, + :x2 611.2964477539062, + :y2 974.5, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 350.953125, + :y1 953.5, + :x2 611.2964477539062, + :y2 974.5, + :width 1036.8, + :height 1555.2}), + :page 586}, + :content {:text "recursive update problem"}, + :properties {:color "yellow"}} + {:id #uuid "643bb533-1fee-4b9a-9965-7a63016d5591", + :page 586, + :position {:bounding {:x1 689.9594116210938, + :y1 1049.140625, + :x2 778.8189697265625, + :y2 1070.140625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 689.9594116210938, + :y1 1049.140625, + :x2 778.8189697265625, + :y2 1070.140625, + :width 1036.8, + :height 1555.2}), + :page 586}, + :content {:text "entailed "}, + :properties {:color "green"}} + {:id #uuid "643bb6cb-61ae-4231-aaf4-d78f1b1a7851", + :page 587, + :position {:bounding {:x1 332.2984924316406, + :y1 214.8125, + :x2 563.9093627929688, + :y2 240.8125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 332.2984924316406, + :y1 214.8125, + :x2 563.9093627929688, + :y2 240.8125, + :width 1036.8, + :height 1555.2}), + :page 587}, + :content {:text "Garbage Collection"}, + :properties {:color "yellow"}} + {:id #uuid "643bb6e8-6466-4574-aa04-4ea25b3e9034", + :page 587, + :position {:bounding {:x1 234.57150268554688, + :y1 358.609375, + :x2 358.42340087890625, + :y2 379.609375, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 234.57150268554688, + :y1 358.609375, + :x2 358.42340087890625, + :y2 379.609375, + :width 1036.8, + :height 1555.2}), + :page 587}, + :content {:text "ceremoniously"}, + :properties {:color "green"}} + {:id #uuid "643bb7e4-6d90-4d59-8930-29a243862288", + :page 588, + :position {:bounding {:x1 206.265625, + :y1 883.8125, + :x2 532.0180053710938, + :y2 909.8125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 206.265625, + :y1 883.8125, + :x2 532.0180053710938, + :y2 909.8125, + :width 1036.8, + :height 1555.2}), + :page 588}, + :content {:text "Determining Block Liveness"}, + :properties {:color "yellow"}} + {:id #uuid "643bb91c-62a0-4154-8d12-c9ae356a4fc7", + :page 588, + :position {:bounding {:x1 355.3645935058594, + :y1 510, + :x2 837.0833129882812, + :y2 531, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 355.3645935058594, + :y1 510, + :x2 837.0833129882812, + :y2 531, + :width 1036.8, + :height 1555.2}), + :page 588}, + :content {:text " LFS cleaner works on a segment-by-segment basis"}, + :properties {:color "yellow"}} + {:id #uuid "643bba1e-4f7b-4291-bdd8-966dd366748c", + :page 588, + :position {:bounding {:x1 266.75, + :y1 1077.515625, + :x2 507.0487976074219, + :y2 1098.515625, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 266.75, + :y1 1077.515625, + :x2 507.0487976074219, + :y2 1098.515625, + :width 1036.8, + :height 1555.2}), + :page 588}, + :content {:text "segment summary block"}, + :properties {:color "yellow"}} + {:id #uuid "643bbc21-a025-4dd4-bdc2-4a1eb68abf5e", + :page 589, + :position {:bounding {:x1 298.84375, + :y1 721.203125, + :x2 454.3841247558594, + :y2 742.203125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 298.84375, + :y1 721.203125, + :x2 454.3841247558594, + :y2 742.203125, + :width 1036.8, + :height 1555.2}), + :page 589}, + :content {:text "version number"}, + :properties {:color "yellow"}} + {:id #uuid "643bbd43-a342-4445-a808-b9800790a83c", + :page 590, + :position {:bounding {:x1 206.2542724609375, + :y1 214.8125, + :x2 390.95660400390625, + :y2 240.8125, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 206.2542724609375, + :y1 214.8125, + :x2 390.95660400390625, + :y2 240.8125, + :width 1036.8, + :height 1555.2}), + :page 590}, + :content {:text "Crash Recovery"}, + :properties {:color "yellow"}} + {:id #uuid "643bc080-2693-4a74-b261-56f92e3c75e4", + :page 590, + :position {:bounding {:x1 506.125, + :y1 933.25, + :x2 626.1741943359375, + :y2 954.25, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 506.125, + :y1 933.25, + :x2 626.1741943359375, + :y2 954.25, + :width 1036.8, + :height 1555.2}), + :page 590}, + :content {:text "roll forward"}, + :properties {:color "yellow"}} + {:id #uuid "643bc10e-be20-47b3-bab4-713493dd5153", + :page 590, + :position {:bounding {:x1 0, + :y1 492, + :x2 897.302001953125, + :y2 1025.96875, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 0, + :y1 492, + :x2 0, + :y2 516, + :width 1036.8, + :height 1555.2} + {:x1 0, + :y1 508, + :x2 0, + :y2 532, + :width 1036.8, + :height 1555.2} + {:x1 206.265625, + :y1 957.140625, + :x2 897.2652587890625, + :y2 978.140625, + :width 1036.8, + :height 1555.2} + {:x1 206.265625, + :y1 981.046875, + :x2 897.302001953125, + :y2 1002.5625, + :width 1036.8, + :height 1555.2} + {:x1 206.265625, + :y1 1004.96875, + :x2 824.5419921875, + :y2 1025.96875, + :width 1036.8, + :height 1555.2}), + :page 590}, + :content {:text "The basic idea is to start with the last checkpoint region, find the end of the log (which is included in the CR), and then use that to read through the next segments and see if there are any valid updates within it. "}, + :properties {:color "yellow"}} + {:id #uuid "643bc4b4-dc22-471c-9229-558a42904cc8", + :page 595, + :position {:bounding {:x1 412.12396240234375, + :y1 1005.921875, + :x2 460.8625183105469, + :y2 1026.921875, + :width 1036.8, + :height 1555.2}, + :rects ({:x1 412.12396240234375, + :y1 1005.921875, + :x2 460.8625183105469, + :y2 1026.921875, + :width 1036.8, + :height 1555.2}), + :page 595}, + :content {:text "cease"}, + :properties {:color "green"}}], + :extra {:page 595}} diff --git a/logseq/bak/logseq/config/2023-04-15T15_41_51.461Z.Desktop.edn b/logseq/bak/logseq/config/2023-04-16T06_01_41.642Z.Desktop.edn similarity index 100% rename from logseq/bak/logseq/config/2023-04-15T15_41_51.461Z.Desktop.edn rename to logseq/bak/logseq/config/2023-04-16T06_01_41.642Z.Desktop.edn diff --git a/logseq/bak/logseq/config/2023-04-13T16_07_56.749Z.Desktop.edn b/logseq/bak/logseq/config/2023-04-16T06_01_48.493Z.Desktop.edn similarity index 99% rename from logseq/bak/logseq/config/2023-04-13T16_07_56.749Z.Desktop.edn rename to logseq/bak/logseq/config/2023-04-16T06_01_48.493Z.Desktop.edn index f69d742..657d2d7 100644 --- a/logseq/bak/logseq/config/2023-04-13T16_07_56.749Z.Desktop.edn +++ b/logseq/bak/logseq/config/2023-04-16T06_01_48.493Z.Desktop.edn @@ -343,6 +343,7 @@ ;; ;use Percent-encoding for other invalid characters :file/name-format :triple-lowbar :ui/show-brackets? true + :feature/enable-timetracking? false ;; specify the format of the filename for journal files ;; :journal/file-name-format "yyyy_MM_dd" diff --git a/logseq/bak/logseq/config/2023-04-13T16_07_58.952Z.Desktop.edn b/logseq/bak/logseq/config/2023-04-16T06_35_35.148Z.Desktop.edn similarity index 99% rename from logseq/bak/logseq/config/2023-04-13T16_07_58.952Z.Desktop.edn rename to logseq/bak/logseq/config/2023-04-16T06_35_35.148Z.Desktop.edn index dec5a7c..10c46a7 100644 --- a/logseq/bak/logseq/config/2023-04-13T16_07_58.952Z.Desktop.edn +++ b/logseq/bak/logseq/config/2023-04-16T06_35_35.148Z.Desktop.edn @@ -343,6 +343,7 @@ ;; ;use Percent-encoding for other invalid characters :file/name-format :triple-lowbar :ui/show-brackets? false + :feature/enable-timetracking? false ;; specify the format of the filename for journal files ;; :journal/file-name-format "yyyy_MM_dd" diff --git a/logseq/bak/logseq/config/2023-04-13T16_08_02.396Z.Desktop.edn b/logseq/bak/logseq/config/2023-04-16T07_03_21.987Z.Desktop.edn similarity index 99% rename from logseq/bak/logseq/config/2023-04-13T16_08_02.396Z.Desktop.edn rename to logseq/bak/logseq/config/2023-04-16T07_03_21.987Z.Desktop.edn index f69d742..657d2d7 100644 --- a/logseq/bak/logseq/config/2023-04-13T16_08_02.396Z.Desktop.edn +++ b/logseq/bak/logseq/config/2023-04-16T07_03_21.987Z.Desktop.edn @@ -343,6 +343,7 @@ ;; ;use Percent-encoding for other invalid characters :file/name-format :triple-lowbar :ui/show-brackets? true + :feature/enable-timetracking? false ;; specify the format of the filename for journal files ;; :journal/file-name-format "yyyy_MM_dd" diff --git a/logseq/bak/logseq/config/2023-04-14T03_58_23.691Z.Desktop.edn b/logseq/bak/logseq/config/2023-04-16T08_11_54.939Z.Desktop.edn similarity index 99% rename from logseq/bak/logseq/config/2023-04-14T03_58_23.691Z.Desktop.edn rename to logseq/bak/logseq/config/2023-04-16T08_11_54.939Z.Desktop.edn index f69d742..10c46a7 100644 --- a/logseq/bak/logseq/config/2023-04-14T03_58_23.691Z.Desktop.edn +++ b/logseq/bak/logseq/config/2023-04-16T08_11_54.939Z.Desktop.edn @@ -342,7 +342,8 @@ ;; ;use triple underscore `___` for slash `/` in page title ;; ;use Percent-encoding for other invalid characters :file/name-format :triple-lowbar - :ui/show-brackets? true + :ui/show-brackets? false + :feature/enable-timetracking? false ;; specify the format of the filename for journal files ;; :journal/file-name-format "yyyy_MM_dd" diff --git a/logseq/config.edn b/logseq/config.edn index 10c46a7..657d2d7 100644 --- a/logseq/config.edn +++ b/logseq/config.edn @@ -342,7 +342,7 @@ ;; ;use triple underscore `___` for slash `/` in page title ;; ;use Percent-encoding for other invalid characters :file/name-format :triple-lowbar - :ui/show-brackets? false + :ui/show-brackets? true :feature/enable-timetracking? false ;; specify the format of the filename for journal files diff --git a/logseq/custom.css b/logseq/custom.css index e69de29..875356f 100644 --- a/logseq/custom.css +++ b/logseq/custom.css @@ -0,0 +1,7 @@ +:root { + --ls-font-family: Noto Sans CJK SC, Helvetica Neue, sans-serif; +} + +* { + font-variant-ligatures: none !important; +} diff --git a/pages/hls__ostep_1681115599584_0.md b/pages/hls__ostep_1681115599584_0.md index 25a1189..f8799ce 100644 --- a/pages/hls__ostep_1681115599584_0.md +++ b/pages/hls__ostep_1681115599584_0.md @@ -908,7 +908,6 @@ file-path:: ../assets/ostep_1681115599584_0.pdf id:: 6437a50f-5c6c-47ff-9179-ac48118342d7 hl-color:: yellow - **IO time** - collapsed:: true - **Rotational Delay**: wait for the desired sector to rotate under the disk head hl-page:: 466 ls-type:: annotation @@ -1049,6 +1048,7 @@ file-path:: ../assets/ostep_1681115599584_0.pdf ls-type:: annotation id:: 6437f261-2d97-4f0c-85aa-06dd6d230ce0 hl-color:: yellow + collapsed:: true - spread the blocks of the array across the disks in a round-robin fashion ls-type:: annotation hl-page:: 483 @@ -1129,6 +1129,7 @@ file-path:: ../assets/ostep_1681115599584_0.pdf ls-type:: annotation id:: 6438241b-f487-4cf3-b717-60811340a5bd hl-color:: yellow + collapsed:: true - Improved version of *RAID4*, RAID5 rotate the parity block across drives. - ((64382b1e-7c59-4729-a70f-68005b0640b4)) - **Performance** @@ -1504,7 +1505,7 @@ file-path:: ../assets/ostep_1681115599584_0.pdf ls-type:: annotation id:: 643ac9e7-1479-4be9-81fe-acb750f363b4 hl-color:: yellow - - Potential Performance: large sequential read from a large file. However, with selected chunk size (threshold of going to another group), ==cost of seek between groups can be amortized==. The larger size of a chunk, the higher average bandwidth you will reach. + - Potential Performance Problem: large sequential read from a large file. However, with selected chunk size (threshold of going to another group), ==cost of seek between groups can be amortized==. The larger size of a chunk, the higher average bandwidth you will reach. - Measuring File Locality hl-page:: 550 ls-type:: annotation @@ -1548,4 +1549,292 @@ file-path:: ../assets/ostep_1681115599584_0.pdf hl-page:: 558 ls-type:: annotation id:: 643acfc2-eef7-4c7f-a8a5-1740c8788159 - hl-color:: yellow \ No newline at end of file + hl-color:: yellow + collapsed:: true + - Crash Scenarios + ls-type:: annotation + hl-page:: 560 + hl-color:: yellow + id:: 643b7d72-4da5-42cf-abd5-dbbc3d9332d7 + collapsed:: true + - Consider a ==write operation with new data block allocation== in the `vsfs` introduced above, which involves 3 independent write to the disk + - Only one operation is done + - data block: no a problem for FS, as if the write never happened, though user data get lost + - inode: FS inconsistency, bitmap says it is not allocated while inode says it is, read garbage from the block + - data bitmap: FS inconsistency, space leak, the block won't be utilized forever + - Two operations are done + - inode and bitmap: read garbage, though FS consistent + - data block and inode/bitmap: inconsistent + - The File System Checker + ls-type:: annotation + hl-page:: 562 + hl-color:: yellow + id:: 643b8161-a7b8-496d-9121-4ce20ee8deb6 + collapsed:: true + - Let inconsistencies happen and then fix them later when rebooting. This approach cannot solve all problems (like data loss), the only goal is to make the FS metadata consistent internally. Run before the FS is mounted + hl-page:: 562 + ls-type:: annotation + id:: 643b81ae-edfd-4a9e-9df2-fdba2175dde2 + hl-color:: yellow + - Basic summary of what `fsck` does + - Superblock: if corrupt, use an ==alternative copy== + - Free blocks: scan inodes, (double/triple...) indirect blocks to collect ==information about allocated blocks== and use this information to ==correct the bitmap==. + - Inode links: traverse the whole directory tree and calculate ==reference count for each inode==. Verify this for each inode. Ff inode allocated without any directory referring to it, move to `lost+found` + - Duplicates: multiple inode pointers point to the same block. Copy the block or clear inode + - Bad blocks, Inode state, Directory checks, etc. + - Problem: too slow + - Journaling (or Write-Ahead Logging) + ls-type:: annotation + hl-page:: 564 + hl-color:: yellow + id:: 643b86d9-afcc-4494-87d1-275502df79a7 + - Basic Idea: Before writing the structures in place, first write a log elsewhere on the disk. If crash takes place during the actual update, FS can fix inconsistency according to the log. + - **Data Journaling** + ls-type:: annotation + hl-page:: 565 + hl-color:: yellow + id:: 643b8dc6-e380-49e3-ab08-ce27aa8767e2 + - **physical logging**: put the exact physical contents of the update in the journal + hl-page:: 565 + ls-type:: annotation + id:: 643b8ebd-b694-4862-90f0-9fb0f1a847f5 + hl-color:: yellow + - **checkpointing**: overwrite the old structures in the FS + hl-page:: 565 + ls-type:: annotation + id:: 643b8eed-3b37-4ac0-b924-9a2d035f2517 + hl-color:: yellow + - **transaction identifier**: transaction begin including information about the pending update, and transaction end marker + hl-page:: 565 + ls-type:: annotation + id:: 643b8f7d-76a2-477e-89ea-1321475b3dbe + hl-color:: yellow + - Journal write: Write the transaction (*Tx Begin* mark, data to update, *Tx End* mark) to log + - To make things faster, instead of issuing serial write requests, we may ==merge these requests.== + id:: 643b9070-8e4c-422a-8173-388fb801930d + - To avoid possible data loss during a single issue (due to internal disk scheduling), the *Tx End* mark must be written with ==a separate request==, while other part of the log can be issued as a package. + - Well, add a checksum is also a solution. With checksum, you can write all these stuff in a single request. If disk failed to propagate all of the bits to disk, this failure will be notice during the reboot scan and the log will be skipped. + hl-page:: 567 + ls-type:: annotation + id:: 643b9816-e478-4f45-a5bd-fbe168fdc406 + hl-color:: yellow + - Thus, this step can be split into 2 stages: ==Journal Write and Journal Commit==, which respectively means write Tx Begin mark and pending update and write Tx End mark. + - To re-use the log region, add a journal superblock on the disk for information about transaction checkpoint completion (free checkpointed ones). Perhaps a circular log. + - Protocol + - hl-page:: 570 + ls-type:: annotation + id:: 643b9e00-4597-4a1a-890a-be95041f6b3b + hl-color:: yellow + 1. **Journal write**: Write the contents of the transaction (Tx Begin, contents of the update) to the log; wait for these writes to complete. + 2. **Journal commit**: Write the transaction commit block (Tx End) to the log; wait for the write to complete; the transaction is now committed. + 3. **Checkpoint**: Write the contents of the update to their final locations within the file system. + 4. **Free**: Some time later, mark the transaction free in the journal by updating the journal superblock. + - Recovery + ls-type:: annotation + hl-page:: 568 + hl-color:: yellow + id:: 643b9301-4a07-459a-a413-5c2738560e10 + - Crash before transaction commit, skip. + - Crash after transaction commit (but before checkpointing complete), replay. + - Redo Logging: On reboot, scan the log for committed transactions and try to write them again. + - **Metadata Journaling** + ls-type:: annotation + hl-page:: 570 + hl-color:: yellow + id:: 643b96ec-18c9-4053-be7e-3b7d3b7dbbbd + - Data journaling doubles the traffic to disk, and seek between log area and main data area is costly. + - Metadata journaling writes metadata to log without data block. Data block is written directly to main data area before metadata is logged. + - Protocol + - hl-page:: 571 + ls-type:: annotation + id:: 643b9b7c-a43e-4c50-9dec-1d8f30bae712 + hl-color:: yellow + 1. **Data write**: Write data to final location; wait for completion (optional). + 2. **Journal metadata write**: Write the begin block and metadata to log; wait for writes to complete. + 3. **Journal commit**: Write the transaction commit block (Tx End) to log; wait for the write to complete; the transaction (including data) is now committed. + 4. **Checkpoint metadata**: Write the contents of the metadata update to their final locations in FS. + 5. **Free**: Later, mark the transaction free in journal superblock. + - Actually, step 1 and step 2 can be issued concurrently, but Step 3 must wait for Step 1 and 2. + - Tricky Case: Block Reuse + ls-type:: annotation + hl-page:: 572 + hl-color:: yellow + id:: 643b9c5a-c06b-4a4b-af75-9a2242069fc8 + - Replay can cause data block to be overwritten when the block is re-used after deletion and the log is not freed in time. + - Well, the key point actually lies in that, directory information is considered as metadata. If the original block is a directory, the following operation sequence will cause problem: modify the directory entries, delete the directory, re-used the directory's block for a file. The recovery process will overwritten the file's data block with the old, deleted directory data. + - Other Approaches + ls-type:: annotation + hl-page:: 574 + hl-color:: yellow + id:: 643ba14d-00f4-4f92-921c-740f3b6def61 + - Soft updates: carefully order the writes to ensure on-disk structure is consistent at any time + - COW: never overwrite in place + - back-pointer: add backward pointer to inode to check consistency + - optimistic crash consistency: kind of transaction checksum +- premise + ls-type:: annotation + hl-page:: 563 + hl-color:: green + id:: 643b824d-2732-46ae-961d-74a06db18138 +- tad + ls-type:: annotation + hl-page:: 563 + hl-color:: green + id:: 643b824f-c588-4b82-93e6-393016d3b5b1 +- hideous + ls-type:: annotation + hl-page:: 572 + hl-color:: green + id:: 643b9c40-6329-4720-9d26-75a78701392c +- hairy + ls-type:: annotation + hl-page:: 572 + hl-color:: green + id:: 643b9c49-9e7c-4379-a640-8aff152ea511 +- ## Log-structured File Systems + hl-page:: 579 + ls-type:: annotation + id:: 643b8dad-3813-4048-8d04-5eb93a6bd182 + hl-color:: yellow + - **Writing To Disk Sequentially** + hl-page:: 580 + ls-type:: annotation + id:: 643bab9f-04f5-4e2f-b232-d6cfead45619 + hl-color:: yellow + - write all updates (including metadata) to the disk sequentially, e.g. write a new data block, and then write its newly updated inode sequentially after it (rather than seek to the inode region far away) + - **Write Buffering** + hl-page:: 581 + ls-type:: annotation + id:: 643bac5e-ce70-4d9b-92c5-4fb6dda099d6 + hl-color:: yellow + - Writing sequentially alone doesn't mean good performance. A ==large number of contiguous writes or one large write== is the key to good write performance. + - Before writing to the disk, LFS ==keeps track of updates in memory==; when it has received a sufficient number of updates, (a *segment*) it writes them to disk all at once. + hl-page:: 581 + ls-type:: annotation + id:: 643bac81-cd5a-49aa-a81b-aff6c2405a40 + hl-color:: yellow + - Segment size: similar to evaluation here ((6437feab-eceb-4f11-9ced-ae43e2798c0c)). The larger chunk size, the better performance. + hl-page:: 582 + ls-type:: annotation + id:: 643bb0bc-9781-484e-b249-224d89414165 + hl-color:: yellow + - The effective rate of writing $R_{\text{effective}}$ and chunk size $D$: + $$R_{\text{effective}} = \frac{D}{T_{\text{write}}} = \frac{D}{T_{\text{position}}+\frac{D}{R_{\text{peak}}} } \\ D = \frac{F}{1-F}\times R_{\text{peak}} \times T_{\text{position}}$$ + - **The Inode Map**, Finding inodes + hl-page:: 583 + ls-type:: annotation + id:: 643bb0f6-b84c-469e-8188-0db6e86f36e8 + hl-color:: yellow + - The i-map is a structure that maps inode-number to the disk address of the most recent version of the inode + hl-page:: 583 + ls-type:: annotation + id:: 643bb162-9f99-4740-8fd6-859f236c1855 + hl-color:: yellow + - LFS places chunks of the ==inode map right next to the other new information==. For example, when appending a data block to a file, LFS actually writes the new data block, its inode, and a piece of the inode map all together. + - **The Checkpoint Region** + hl-page:: 585 + ls-type:: annotation + id:: 643bb250-205a-4ae9-8cff-0d715cfa6b7d + hl-color:: yellow + - Contains pointers to the latest pieces of the inode map. Note the checkpoint region is only updated periodically, without reduce performance too much. + - The look up process + - First look up CR for i-map (often cached in memory), then consult i-map for the directory's inode, then get file inode number from directory, finally consult i-map again for file's inode + - recursive update problem: Whenever an inode is updated, its location on disk changes. This would have also entailed an update to the directory that points to this file (change the pointer field, thus the directory needs to be written to a new location), which then would have mandated a change to the parent of that directory, and so on, all the way up the file system tree. + hl-page:: 586 + ls-type:: annotation + id:: 643bb4de-bc1f-4f61-a5dd-036867e85fe7 + hl-color:: yellow + - This won't be a problem for LFS. LFS maps inode number to address and directories store inode numbers rather than addresses, so even the inode moves to a new location there is no need to change the directory. + - Garbage Collection + ls-type:: annotation + hl-page:: 587 + hl-color:: yellow + id:: 643bb6cb-61ae-4231-aaf4-d78f1b1a7851 + - LFS leaves old versions of file structures scattered throughout the disk, though only the latest version is needed. Therefore, LFS has to periodically ==clean these old versions== of data and metadata. + - LFS cleaner works on a ==segment-by-segment basis==. Read in a number of old segments, collect live blocks, write them out to a new set of segments and finally free the old segments. + hl-page:: 588 + ls-type:: annotation + id:: 643bb91c-62a0-4154-8d12-c9ae356a4fc7 + hl-color:: yellow + - Determining Block Liveness + ls-type:: annotation + hl-page:: 588 + hl-color:: yellow + id:: 643bb7e4-6d90-4d59-8930-29a243862288 + - segment summary block: inode number and in-file offset of each data block + hl-page:: 588 + ls-type:: annotation + id:: 643bba1e-4f7b-4291-bdd8-966dd366748c + hl-color:: yellow + - Pseudocode depiction + - ```python + # A -> block address + # N -> inode number + # T -> offset in file + (N,T) = SegmentSummary[A] + inode = Read(imap[N]) + if (inode[T] == A): + return live + else: + return dead + ``` + - **version number**: in some cases (e.g., file deleted), LFS records file's version number in imap and summary block, and compares them during GC to speed up the check + hl-page:: 589 + ls-type:: annotation + id:: 643bbc21-a025-4dd4-bdc2-4a1eb68abf5e + hl-color:: yellow + - Crash Recovery + ls-type:: annotation + hl-page:: 590 + hl-color:: yellow + id:: 643bbd43-a342-4445-a808-b9800790a83c + - General write scheme + - LFS organizes writes in a log, i.e. the CR points to a head and tail segment, and each segment points to the next segment to write. CR is propagated to disk periodically. + - To make it clear, there is no separate "log" space on the disk similar to what journaling FSs do. The segments written to the disk are logs by themselves. See [Page 30, Figure 4-1, R92](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1992/CSD-92-696.pdf) + - Checkpoint Region + - LFS keeps 2 CRs (at both ends of the disk) and write alternately. On writing, LFS first writes header (with timestamp), then body, finally a last block (with timestamp). In this way, crashes can be detected through inconsistent timestamps, and LFS can choose the latest CR to use. + - Roll Forward + hl-page:: 590 + ls-type:: annotation + id:: 643bc080-2693-4a74-b261-56f92e3c75e4 + hl-color:: yellow + - The basic idea is to start with the last checkpoint region, find the end of the log (included in the CR), and then use that to read through the next segments and see if there are any valid updates. + hl-page:: 590 + ls-type:: annotation + id:: 643bc10e-be20-47b3-bab4-713493dd5153 + hl-color:: yellow +- ## Flash-based SSDs + ls-type:: annotation + hl-page:: 595 + hl-color:: yellow + id:: 643ba369-83df-42f9-9ee9-b45d4652e8fb +- ## Data Integrity and Protection + ls-type:: annotation + hl-page:: 619 + hl-color:: yellow + id:: 643ba392-acd9-4255-930e-a97f94fb28ef +- spouse + ls-type:: annotation + hl-page:: 633 + hl-color:: green + id:: 643ba3b2-5a2a-4589-a871-62ad213de195 +- mandate + ls-type:: annotation + hl-page:: 586 + hl-color:: green + id:: 643bb439-b7d0-4170-9417-cd900062bfbd +- entail + ls-type:: annotation + hl-page:: 586 + hl-color:: green + id:: 643bb533-1fee-4b9a-9965-7a63016d5591 +- ceremonious + ls-type:: annotation + hl-page:: 587 + hl-color:: green + id:: 643bb6e8-6466-4574-aa04-4ea25b3e9034 +- cease + ls-type:: annotation + hl-page:: 595 + hl-color:: green + id:: 643bc4b4-dc22-471c-9229-558a42904cc8 \ No newline at end of file