Skip to content

Commit

Permalink
Handle calls and queries in receive_snapshot state
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Aug 19, 2024
1 parent e2cffb7 commit ed3526a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ra_server_proc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,18 @@ receive_snapshot(enter, OldState, State0 = #state{conf = Conf}) ->
| Actions]};
receive_snapshot(_, tick_timeout, State0) ->
{keep_state, State0, set_tick_timer(State0, [])};
receive_snapshot({call, From}, {leader_call, Msg}, State) ->
maybe_redirect(From, Msg, State);
receive_snapshot(EventType, {local_call, Msg}, State) ->
receive_snapshot(EventType, Msg, State);
receive_snapshot({call, _From} = EventType, {local_query, QueryFun}, State) ->
receive_snapshot(EventType, {local_query, QueryFun, #{}}, State);
receive_snapshot({call, From}, {local_query, QueryFun, Options}, State) ->
perform_or_delay_local_query(
await_condition, From, QueryFun, Options, State);
receive_snapshot({call, From}, {state_query, Spec}, State) ->
Reply = {ok, do_state_query(Spec, State), id(State)},
{keep_state, State, [{reply, From, Reply}]};
receive_snapshot(EventType, Msg, State0) ->
case handle_receive_snapshot(Msg, State0) of
{receive_snapshot, State1, Effects} ->
Expand Down

0 comments on commit ed3526a

Please sign in to comment.