-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vere: chunk event log into epochs #5701
Conversation
This is great! I'll come back with a more detailed review soon, but wanted to get these notes to you ASAP. This PR removes some functionality (some of which was added/restored while your branch was in progress):
We'll need to refactor some of these Finally, the new module names also aren't going to fly. While we occasionally drift (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More info about CI failures:
ffd8012
to
61d3429
Compare
A summary of the latest batch of commits that I pushed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bookmark: review of c3
changes complete.
Unfortunately, the work this PR was built on top of (the mars/"urth" refactor) had a show stopping bug that required the underlying work in it to get broken down and shipped in pieces (I can't find any details about this bug anywhere in github - if there's a link please add it here). As a result, this PR cannot ship as is and would need to be reimplemented on top of the current vere. The underlying work this PR is built on that can be safely pulled out and shipped independently from the mars/urth refactor is being pulled out and shipped separately (memory corruption fixes, demand paging, other fixes in the 1.14rc). Joe is working on a minimal command line version of event log truncation in the mean time which should help us be unblocked and we'll see if that's able to ship before he's out. We'll take a look at this live implementation work in the new runtime repo once we have that doing releases. |
Split the event log into epochs, which will enable event log truncation.
The new directory hierarchy of the
<pier>/.urb/log
directory looks like:Each epoch contains a
version.bin
file specifying the epoch version it represents as well as an LMDB instance for storing the epoch's events. The first epoch0i1
, haslifecycle.bin
, which specifies the length of the boot sequence. All non-first epochs have snapshots representing the state of the system immediately before the epoch's first event was applied (i.e. applying the snapshot in0i112
is equivalent to replaying up to and including event111
).Migration from the old event log format is in place so long as the incremental snapshot is up to date with the event log. If not, instructions for how to prepare for migration are printed to the console should migration fail. Rollover to a new epoch occurs immediately after migration.
Rollover to a new epoch is dictated by a fixed max event count for an epoch; when the max event count is reached, a new epoch is automatically created.
Key additions:
epoc
module: manages the persistence of an epoch behind a simple interface. The storage method is still LMDB, but nothing about theepoc
interface leaks that information, and so it should be fairly easy to swap in a different database should the need arise.evlo
module: manages the epochs that comprise the event log behind a simple interface and provides both synchronous and asynchronous commit options. Similar to theepoc
interface, theevlo
interface hides the existence of epochs from the users, which enables greater flexibility should the need to change the event log structure arise sometime in the future.Key dependencies:
list
module: doubly-linked list abstraction.path
module: file path abstraction.bile
module: binary file abstraction.Remaining loose ends:
Next steps:
Testing:
ls dev/.urb/log
. Both replay and migration were tested when a single epoch (i.e.0i1
) was present and when multiple epochs (up to ten of them) were present.