Skip to content

Instantly share code, notes, and snippets.

@belisarius222
Created February 7, 2023 21:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save belisarius222/941b27d6558e3d3ff1165f5eee10870d to your computer and use it in GitHub Desktop.
Save belisarius222/941b27d6558e3d3ff1165f5eee10870d to your computer and use it in GitHub Desktop.
epoch-based event log truncation
  • yes to epoch system
  • each epoch has a version file, an initial snapshot, and an event log database file
  • we will need to add code to vere to find the latest epoch folder before loading snapshot and event log
  • there are two separable operations involved in truncation:
  1. create new epoch, by copying snapshot into a new epoch folder, creating a new version file in that folder, and creating a new event log database file in that folder whose events db is empty and whose metadata db contains entries copied from the previous epoch's metadata db
  2. a "keep only N recent epochs" command, which removes all epoch folders older than that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment