Reaves.dev

v0.1.0

built using

Phoenix v1.7.17

Lightweight Recoverable Virtual Memory

Stephen M. Reaves

::

2024-04-18

Notes about Lecture 8a for CS-6210

Summary

Persistence

Server Design

Persistent Metadta, normal datastructures + code go into Virtual Address Space

Create external data segments to back persistent data structures

RVM Primitives

Initialization

Body of Server Code

GC to reduce log space

Misc

Simplicity comes from having a small set of primitives

How the Server Uses the Primitives

Initialize address space from Ext Segs

begin_xact(tid, mode);
  set_range(tid, base_addr, num_of_bytes); // Creates an 'undo' record
  write_metadata(m1);                      // Contained in range
  write_metadata(m2);                      // Contained in range
end_xact(tid, mode);                       // Creates 'redo' record

You can set a no_restore mode to tell LRVM to not create undo record

No action created by LRVM for write_metadata

Flush redo log to disk (sync) before we consider changes to be committed

Transaction Optimizations

Implementation

Redo log

lrvm redo log

Crash Recovery

To resume after crash:

  1. Read redo log from disk
  2. Apply to data segment

Log Truncation

  1. Apply Crash Recovery protocol
  2. Delete log

Done in parallel with forward processing