File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments