Skip to content

Commit 10a9577

Browse files
committed
restore 2.0: add FileRd tile
1 parent 56a71de commit 10a9577

File tree

9 files changed

+457
-3
lines changed

9 files changed

+457
-3
lines changed

src/app/firedancer-dev/main.c

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ extern fd_topo_run_tile_t fd_tile_archiver_feeder;
9191
extern fd_topo_run_tile_t fd_tile_archiver_writer;
9292
extern fd_topo_run_tile_t fd_tile_archiver_playback;
9393

94+
extern fd_topo_run_tile_t fd_tile_snapshot_restore_FileRd;
95+
9496
fd_topo_run_tile_t * TILES[] = {
9597
&fd_tile_net,
9698
&fd_tile_netlnk,
@@ -120,6 +122,7 @@ fd_topo_run_tile_t * TILES[] = {
120122
&fd_tile_archiver_feeder,
121123
&fd_tile_archiver_writer,
122124
&fd_tile_archiver_playback,
125+
&fd_tile_snapshot_restore_FileRd,
123126
NULL,
124127
};
125128

src/disco/stem/fd_stem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
struct fd_stem_context {
99
fd_frag_meta_t ** mcaches;
1010
ulong * seqs;
11-
ulong * depths;
11+
ulong const * depths;
1212

1313
ulong * cr_avail;
1414
ulong cr_decrement_amount;

src/disco/topo/fd_topo.h

+4
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ typedef struct {
421421
int archive_fd;
422422
} archiver;
423423

424+
struct {
425+
char file_path[ PATH_MAX ];
426+
} filerd;
427+
424428
};
425429
} fd_topo_tile_t;
426430

src/disco/topo/fd_topob.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fd_topob_obj( fd_topo_t * topo,
6464
return obj;
6565
}
6666

67-
void
67+
fd_topo_link_t *
6868
fd_topob_link( fd_topo_t * topo,
6969
char const * link_name,
7070
char const * wksp_name,
@@ -100,6 +100,8 @@ fd_topob_link( fd_topo_t * topo,
100100
FD_TEST( fd_pod_insertf_ulong( topo->props, mtu, "obj.%lu.mtu", obj->id ) );
101101
}
102102
topo->link_cnt++;
103+
104+
return link;
103105
}
104106

105107
void

src/disco/topo/fd_topob.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fd_topob_tile_uses( fd_topo_t * topo,
7272
can have no backing data buffer, a dcache, or a reassembly buffer
7373
behind it. */
7474

75-
void
75+
fd_topo_link_t *
7676
fd_topob_link( fd_topo_t * topo,
7777
char const * link_name,
7878
char const * wksp_name,

src/discof/restore/Local.mk

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$(call add-objs,fd_filerd_tile,fd_discof)

src/discof/restore/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Snapshot Restore
2+
3+
## Stream link conventions
4+
5+
Various snapshot components use byte streams, not packet streams.
6+
7+
These require custom conventions.
8+
9+
**Stream fragment descriptors**
10+
11+
Byte streams use `fd_frag_stream_meta_t` (defined in `fd_restore_base.h`).
12+
13+
These have the following changes:
14+
- `chunk` is replaced by `goff` and `loff`, which are 64-bit offsets
15+
describing the stream offset and dcache offset respectively
16+
- `tsorig` / `tspub` are removed (latency is less relevant)
17+
- `sig` is removed (cannot filter without looking at stream data)
18+
- `sz` is widened to 32 bits.
19+
20+
`**Dcache allocations**
21+
22+
Payloads in stream dcaches are unaligned. Payloads are addressed with
23+
uncompressed byte offsets relative to the workspace start.
24+
25+
(Compare this to the usual compact packet dcaches, which use 64 byte
26+
aligned chunks with compressed addressing.)
27+
28+
**Stream backpressure**
29+
30+
Byte streams naturally require a reliable transport.
31+
32+
Consumers periodically publish their progress in `fseq`.
33+
- `fseq[0]` is the lowest sequence number not yet consumed (standard)
34+
- `fseq[1]` is the stream offset of the next byte not yet consumed
35+
`

0 commit comments

Comments
 (0)