Skip to content

Commit 44ee4e5

Browse files
committed
restore 2.0: add FileRd tile
1 parent e0de87d commit 44ee4e5

File tree

9 files changed

+456
-9
lines changed

9 files changed

+456
-9
lines changed

src/app/firedancer-dev/main.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ extern fd_topo_run_tile_t fd_tile_archiver_feeder;
9595
extern fd_topo_run_tile_t fd_tile_archiver_writer;
9696
extern fd_topo_run_tile_t fd_tile_archiver_playback;
9797

98-
extern fd_topo_run_tile_t fd_tile_bencho;
99-
extern fd_topo_run_tile_t fd_tile_benchg;
100-
extern fd_topo_run_tile_t fd_tile_benchs;
98+
extern fd_topo_run_tile_t fd_tile_snapshot_restore_FileRd;
10199

102100
fd_topo_run_tile_t * TILES[] = {
103101
&fd_tile_net,
@@ -131,9 +129,7 @@ fd_topo_run_tile_t * TILES[] = {
131129
&fd_tile_archiver_feeder,
132130
&fd_tile_archiver_writer,
133131
&fd_tile_archiver_playback,
134-
&fd_tile_bencho,
135-
&fd_tile_benchg,
136-
&fd_tile_benchs,
132+
&fd_tile_snapshot_restore_FileRd,
137133
NULL,
138134
};
139135

src/disco/stem/fd_stem.h

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ typedef struct {
428428
int archive_fd;
429429
} archiver;
430430

431+
struct {
432+
char file_path[ PATH_MAX ];
433+
} filerd;
434+
431435
};
432436
} fd_topo_tile_t;
433437

src/disco/topo/fd_topob.c

Lines changed: 3 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 35 additions & 0 deletions
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)