Skip to content

Commit

Permalink
remove noisy logs when witness times out
Browse files Browse the repository at this point in the history
Summary: Remove logging on witness timeout after not hearing a heartbeat from leader.

Differential Revision: D53452659

fbshipit-source-id: f52c370a8092abfb640a48bd649cc8effe3ab978
  • Loading branch information
Sarah Hassan authored and facebook-github-bot committed Feb 6, 2024
1 parent ad8560c commit 3b9346f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/wa_raft_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1455,15 +1455,7 @@ witness(internal, ?ADVANCE_TERM(Term), #raft_state{name = Name, current_term = C
[Name, CurrentTerm, Term], #{domain => [whatsapp, wa_raft]}),
keep_state_and_data;

witness(state_timeout, _, #raft_state{name = Name, current_term = CurrentTerm, leader_id = LeaderId,
log_view = View, leader_heartbeat_ts = HeartbeatTs} = State) ->
WaitingMs = case HeartbeatTs of
undefined -> undefined;
_ -> erlang:monotonic_time(millisecond) - HeartbeatTs
end,
?LOG_NOTICE("Server[~0p, term ~0p, witness] times out after ~p ms. Last leader ~p. Max log index ~p.",
[Name, CurrentTerm, WaitingMs, LeaderId, wa_raft_log:last_index(View)], #{domain => [whatsapp, wa_raft]}),
?RAFT_COUNT('raft.witness.timeout'),
witness(state_timeout, _, State) ->
{repeat_state, State};

%% [Protocol] Handle any RPCs
Expand Down

0 comments on commit 3b9346f

Please sign in to comment.