Skip to content

Commit

Permalink
Let transport logic be responsible for cleaning up a snapshot that ca…
Browse files Browse the repository at this point in the history
…n't be loaded

Summary: as title

Reviewed By: SarahDesouky

Differential Revision:
D67520565

Privacy Context Container: L1141030

fbshipit-source-id: 6d7d154961c80fe5c6c06d9b7aadf186cff08e06
  • Loading branch information
Jose-Angel Herrero Bajo authored and facebook-github-bot committed Dec 20, 2024
1 parent 6672689 commit 1d9acc0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/wa_raft_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -784,10 +784,6 @@ stalled({call, From}, ?SNAPSHOT_AVAILABLE_COMMAND(Root, #raft_log_pos{index = Sn
?LOG_WARNING("Server[~0p, term ~0p, stalled] failed to load available snapshot ~p due to ~p",
[Name, CurrentTerm, Root, Reason], #{domain => [whatsapp, wa_raft]}),
{keep_state_and_data, {reply, From, {error, Reason}}}
after
% It is assumed that the loading of the snapshot will move the snapshot away or
% otherwise disassociate the storage state from the snapshot path.
catch file:del_dir_r(Root)
end;
false ->
?LOG_NOTICE("Server[~0p, term ~0p, stalled] ignoring available snapshot ~p:~p with index not past ours (~p)",
Expand Down

0 comments on commit 1d9acc0

Please sign in to comment.