Skip to content

Commit 69c12a8

Browse files
nathanielcdav1do
authored andcommitted
more notes
1 parent edcbf08 commit 69c12a8

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

pipeline/src/resolver/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,24 @@ impl Resolver {
189189
.into_view(),
190190
)?;
191191

192+
// TODO: This is a bit over simplified.
193+
//
194+
// Here we assume that the stream_tips and stream_states tables remain in lock step (i.e.
195+
// we can atomically write to both)
196+
//
197+
// However that is not a safe assumption.
198+
//
199+
// I see two ways to solve this:
200+
//
201+
// 1. Use two different actors, a tips actor and a resolver actor.
202+
// Then have the resolver actor subscribe the tips actor and use the stream_tip_order to
203+
// ensure it makes forward progress atomically.
204+
//
205+
// 2. Keep this single actor but track the stream_tip_order and stream_state order
206+
// separately so that we get the same atomicity with the complexity of two actors.
207+
//
208+
// In short one complicated actor or two simpler actors.
209+
192210
// Query for max event_state_order and stream_state_order in persistent stream_states, this is where we should start
193211
// the new order values.
194212
let batches = ctx

0 commit comments

Comments
 (0)