Skip to content

Commit 3b54427

Browse files
hsun324facebook-github-bot
authored andcommitted
Remove direct manipulation of storage state
Summary: Remove an export that uses `sys:replace_state/2` to directly manipulate storage state since `make_empty_snapshot` and `open_snapshot` can now achieve the same result. Reviewed By: jaher Differential Revision: D72437281 fbshipit-source-id: 499548a08ebaa9b29dd9fe68b2c34841b3c1993f
1 parent 1d23d81 commit 3b54427

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/wa_raft_storage.erl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@
6969
code_change/3
7070
]).
7171

72-
%% Test API
73-
-ifdef(TEST).
74-
-export([
75-
reset/3
76-
]).
77-
-endif.
78-
7972
-export_type([
8073
storage_handle/0,
8174
metadata/0,
@@ -396,17 +389,6 @@ label(ServiceRef) ->
396389
config(ServiceRef) ->
397390
gen_server:call(ServiceRef, config, ?RAFT_STORAGE_CALL_TIMEOUT()).
398391

399-
-ifdef(TEST).
400-
-spec reset(ServiceRef :: pid() | atom(), Position :: wa_raft_log:log_pos(), Config :: wa_raft_server:config() | undefined) -> ok | error().
401-
reset(ServiceRef, Position, Config) ->
402-
sys:replace_state(ServiceRef, fun (#state{module = Module, handle = Handle} = State) ->
403-
Config =/= undefined andalso
404-
Module:storage_apply_config(Config, Position, Handle),
405-
State#state{last_applied = Position}
406-
end, ?RAFT_STORAGE_CALL_TIMEOUT()),
407-
ok.
408-
-endif.
409-
410392
%%-------------------------------------------------------------------
411393
%% RAFT Storage - Internal API
412394
%%-------------------------------------------------------------------

0 commit comments

Comments
 (0)