-
Notifications
You must be signed in to change notification settings - Fork 35
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
Implement chop
(event log truncation tool)
#122
Comments
Notes from @eamsden and @philipcmonk:
|
First - thanks for creating a detailed issue and writing this up. Tagging @lukebuehler for hosting context.
This work is on deck after the doccords release and getting the fixed replay command out of 1.14 and released in its own release. Also tagging @lukestiles for context. |
@matthew-levan gave of us an overview of the plan and it looks good, some context from our side.
On our side, we're figuring out live snapshotting and truncation but it's possible we'll want to make changes to the runtime prior to that so shouldn't block on it. Thanks for the overview Matt! @mcevoypeter for context. Also @belisarius222 |
Is there documentation anywhere about the chk/bhk system? I know it was added fairly recently, and it has something to do with backup snapshots, but I'm not sure about the details, and I'd like to understand it better. |
I've updated this issue with a working design gist, please see it for add'l context.
@zalberico said that the If possible I'd like to use |
There was a jet mismatch issue, this is the history: urbit/urbit#5836 Basically you can't replay successfully from 0 because you'll hit mug mismatch issues due to this and it will fail. When this was fixed a one time bhk was created post jet mismatch you could replay from there on future runtime versions without having to do complicated switching (I haven't gotten the switching to work myself on my ID that exhibits this, but replaying from bhk does work). With After chop, we'll want to make a separate backup of the first new checkpoint so we can always replay from that copy in the future if the normal checkpoint gets corrupted. |
I see. That makes sense, thanks. |
chop
(event log truncation tool)
## `chop` `urbit chop <pier>` implements a simple, offline **event log truncation**[^1] tool. `chop` gracefully stops the given pier (if running), backs up the current snapshot to `<pier>/.urb/bhk`, makes sure a current snapshot exists (i.e., is fully written to disk in `chk/*.bin` with no existing patch files), reads the metadata and the last event from the pier's event log, initializes a fresh event log in the `<pier>/.urb/log/chop` directory, writes the metadata and last event from the original log into the fresh one, renames the original event log to `<pier>/.urb/log/chop/data_<first>_<last>.mdb.bak` where `first` and `last` are the first and last event numbers from the event log, and exits. Pilots are then free to move, archive, or delete their `.bak` event log file, resume normal operation of their ship, and enjoy the many benefits of lowered disk pressure and any reductions in associated hosting costs. I've tested `chop` successfully on my own planet `~mastyr-bottec` (multiple times), three different comets (all fresh), and multitudes of fake galaxies. Resolves #122. Note: `knit`, which is the "undo" button for `chop`, is being implemented in its own PR #184. [^1]: https://roadmap.urbit.org/project/event-log-truncation
@matthew-levan I ran chop for the first time myself and it doesn't look like it makes a separate post chop backup of
It doesn't look like bhk updated on mine when I checked either. |
Nevermind - it did back it up inside bhk, I was looking at the created date for the directory, not the content - thanks! |
Write a minimally viable event log truncation program. Intended for power users with particularly large piers, it should:
Upon completion, a more permanent, tunable, and feature-rich event log truncation system could be built.
References:
chop
designTagging: @mcevoypeter @joemfb @zalberico
The text was updated successfully, but these errors were encountered: