Skip to content

Snapshot Loader 2.0 #4885

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/firedancer-dev/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ extern fd_topo_run_tile_t fd_tile_archiver_feeder;
extern fd_topo_run_tile_t fd_tile_archiver_writer;
extern fd_topo_run_tile_t fd_tile_archiver_playback;

extern fd_topo_run_tile_t fd_tile_snapshot_restore_FileRd;

fd_topo_run_tile_t * TILES[] = {
&fd_tile_net,
&fd_tile_netlnk,
Expand Down Expand Up @@ -120,6 +122,7 @@ fd_topo_run_tile_t * TILES[] = {
&fd_tile_archiver_feeder,
&fd_tile_archiver_writer,
&fd_tile_archiver_playback,
&fd_tile_snapshot_restore_FileRd,
NULL,
};

Expand Down
2 changes: 1 addition & 1 deletion src/disco/stem/fd_stem.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
struct fd_stem_context {
fd_frag_meta_t ** mcaches;
ulong * seqs;
ulong * depths;
ulong const * depths;

ulong * cr_avail;
ulong cr_decrement_amount;
Expand Down
4 changes: 4 additions & 0 deletions src/disco/topo/fd_topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ typedef struct {
int archive_fd;
} archiver;

struct {
char file_path[ PATH_MAX ];
} filerd;

};
} fd_topo_tile_t;

Expand Down
4 changes: 3 additions & 1 deletion src/disco/topo/fd_topob.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fd_topob_obj( fd_topo_t * topo,
return obj;
}

void
fd_topo_link_t *
fd_topob_link( fd_topo_t * topo,
char const * link_name,
char const * wksp_name,
Expand Down Expand Up @@ -100,6 +100,8 @@ fd_topob_link( fd_topo_t * topo,
FD_TEST( fd_pod_insertf_ulong( topo->props, mtu, "obj.%lu.mtu", obj->id ) );
}
topo->link_cnt++;

return link;
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/disco/topo/fd_topob.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fd_topob_tile_uses( fd_topo_t * topo,
can have no backing data buffer, a dcache, or a reassembly buffer
behind it. */

void
fd_topo_link_t *
fd_topob_link( fd_topo_t * topo,
char const * link_name,
char const * wksp_name,
Expand Down
1 change: 1 addition & 0 deletions src/discof/restore/Local.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(call add-objs,fd_filerd_tile,fd_discof)
35 changes: 35 additions & 0 deletions src/discof/restore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Snapshot Restore

## Stream link conventions

Various snapshot components use byte streams, not packet streams.

These require custom conventions.

**Stream fragment descriptors**

Byte streams use `fd_frag_stream_meta_t` (defined in `fd_restore_base.h`).

These have the following changes:
- `chunk` is replaced by `goff` and `loff`, which are 64-bit offsets
describing the stream offset and dcache offset respectively
- `tsorig` / `tspub` are removed (latency is less relevant)
- `sig` is removed (cannot filter without looking at stream data)
- `sz` is widened to 32 bits.

`**Dcache allocations**

Payloads in stream dcaches are unaligned. Payloads are addressed with
uncompressed byte offsets relative to the workspace start.

(Compare this to the usual compact packet dcaches, which use 64 byte
aligned chunks with compressed addressing.)

**Stream backpressure**

Byte streams naturally require a reliable transport.

Consumers periodically publish their progress in `fseq`.
- `fseq[0]` is the lowest sequence number not yet consumed (standard)
- `fseq[1]` is the stream offset of the next byte not yet consumed
`
Loading
Loading