-
Notifications
You must be signed in to change notification settings - Fork 39
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
epoch system #346
epoch system #346
Conversation
ac9e02c
to
abb4ea7
Compare
7334856
to
5caf39d
Compare
0246c86
to
4162a76
Compare
Midnight update: I can now boot a fresh fakezod with the epoch format,
Thoughts welcome, just taking notes here for my future self. |
That makes sense, thank you sir.
…On Sat, Apr 15, 2023 at 11:05 AM Joe Bryan ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/vere/disk.c
<#346 (comment)>:
>
- if ( c3n == u3_lmdb_gulf(log_u->mdb_u, &fir_d, &log_u->dun_d) ) {
- fprintf(stderr, "disk: failed to load latest event from database\r\n");
- c3_free(log_u);
- return 0;
+ if ( 0 == lat_d ) {
+ c3_d fir_d;
+ if ( c3n == u3_lmdb_gulf(log_u->mdb_u, &fir_d, &log_u->dun_d) ) {
+ log_u->dun_d = 0;
+ }
+ log_u->sen_d = log_u->dun_d;
+ } else {
+ log_u->dun_d = lat_d;
+ log_u->sen_d = log_u->dun_d;
Yeah, they're both event numbers. "commits in flight" would be sen_d -
dun_d.
—
Reply to this email directly, view it on GitHub
<#346 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2DQRBIDXWQMKTEJIHIZ6LXBK2MDANCNFSM6AAAAAAW4B7T3Y>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
c28cc5e
to
5af3f57
Compare
Another update: got |
Thanks for the update! This is exciting.
—
~wolref-podlex
https://urbit.org ( https://urbit.org/ )
…On Mon, Apr 17 2023 at 2:15 AM, Matthew LeVan < ***@***.*** > wrote:
Another update: got roll working nicely. chop is next on the.. chopping
block. prep too. Finally will come the migration code. Stay tuned!
—
Reply to this email directly, view it on GitHub (
#346 (comment) ) , or unsubscribe
(
https://github.com/notifications/unsubscribe-auth/AAEGQQUTMFDFXZEBNS73GA3XBUC2XANCNFSM6AAAAAAW4B7T3Y
).
You are receiving this because you are subscribed to this thread. Message
ID: <urbit/vere/pull/346/c1510989304 @ github. com>
|
|
Implemented a very minimal migration routine for existing piers-- still need to validate there's a current snapshot, rollover to a new epoch, and delete the backup snapshot (in that order).
|
5f521cc
to
6db7bf2
Compare
|
Yes, will do. Thank you, good eye.
…On Thu, Jun 1, 2023 at 2:23 PM barter-simsum ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/vere/disk.c
<#346 (comment)>:
> + // create hard links to data.mdb and lock.mdb in 0i0/
+ c3_c dut_c[8193], luk_c[8193]; // old paths
+ snprintf(dut_c, sizeof(dut_c), "%s/data.mdb", log_u->com_u->pax_c);
+ snprintf(luk_c, sizeof(luk_c), "%s/lock.mdb", log_u->com_u->pax_c);
i.e. at the beginning of this function, dat_c and lok_c store the *old*
paths and later store the new paths when dut_c and luk_c store the old
paths. Just always store the old paths in dut_c and luk_c. Swapping them is
confusing/unnecessary
—
Reply to this email directly, view it on GitHub
<#346 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2DQREZV4DV5YRSUS3TV2LXJDM27ANCNFSM6AAAAAAW4B7T3Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
pushed minor change in f772262. dut_o is pointless, just exit the migration early if data.mdb can't be accessed |
f772262
to
1886844
Compare
Successfully ran a migration on
Note that I also had a |
374b31f
to
cc2557c
Compare
This PR ports urbit/urbit#5676, correcting an integer overflow in the +jam jet (leading to a mismatch on large-atom input). Fixes urbit/urbit#5674. Releasing this fix is blocked on #346. DO NOT MERGE.
This PR implements a new format for how piers store their event logs on disk.
Resolves #313.
Design
Existing format:
New format:
The new format introduces epochs, which are simply "slices" or "chunks" of a ship's complete event log. Above, you can see the ship's event log chunked into two epochs:
0i0
and0i132
.New ships booted with the code in this PR instantiate their
log
directories with the new format. Existing piers are automatically migrated on boot.Epoch "rollovers" (when the current epoch is ended and a new, empty epoch is created) occur under three conditions:
roll
subcommand to manually rollover.chop
subcommand.Both migrations and epoch rollovers ensure there's a current snapshot before running.
A few TODOs left:
prep
commandchop
so it works when there are 3 epochs starting with0i0
Reproduce and fix partially-deleted epoch0i0
afterchop
chop
leave the latest two epochschk/
u3_disk_epoc_good()
is implemented and used how we wantu3_disk_epoc_init()
is implemented and used how we want