Skip to content

Commit

Permalink
Renames hschlag_timestamp to hbeat_timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
rystsov committed Nov 3, 2020
1 parent f07a9e4 commit 7ff2d7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions src/v/raft/consensus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ void consensus::maybe_step_down() {
return clock_type::now();
}

return _fstats.get(id).last_hschlag_timestamp;
return _fstats.get(id).last_hbeat_timestamp;
});

if (majority_hbeat < _became_leader_at) {
majority_hbeat = _became_leader_at;
}

if (
majority_hbeat + _jit.base_duration() < clock_type::now()) {
if (majority_hbeat + _jit.base_duration() < clock_type::now()) {
do_step_down();
}
}
Expand Down Expand Up @@ -205,7 +204,7 @@ consensus::success_reply consensus::update_follower_index(
return success_reply::no;
}

update_node_hschlag_timestamp(node);
update_node_hbeat_timestamp(node);

// If recovery is in progress the recovery STM will handle follower index
// updates
Expand Down Expand Up @@ -1412,11 +1411,11 @@ clock_type::time_point consensus::last_append_timestamp(model::node_id id) {

void consensus::update_node_append_timestamp(model::node_id id) {
_fstats.get(id).last_append_timestamp = clock_type::now();
update_node_hschlag_timestamp(id);
update_node_hbeat_timestamp(id);
}

void consensus::update_node_hschlag_timestamp(model::node_id id) {
_fstats.get(id).last_hschlag_timestamp = clock_type::now();
void consensus::update_node_hbeat_timestamp(model::node_id id) {
_fstats.get(id).last_hbeat_timestamp = clock_type::now();
}

follower_req_seq consensus::next_follower_sequence(model::node_id id) {
Expand Down
2 changes: 1 addition & 1 deletion src/v/raft/consensus.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class consensus {

void arm_vote_timeout();
void update_node_append_timestamp(model::node_id);
void update_node_hschlag_timestamp(model::node_id);
void update_node_hbeat_timestamp(model::node_id);

void update_follower_stats(const group_configuration&);
void trigger_leadership_notification();
Expand Down
2 changes: 1 addition & 1 deletion src/v/raft/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct follower_index_metadata {
model::offset next_index;
// timestamp of last append_entries_rpc call
clock_type::time_point last_append_timestamp;
clock_type::time_point last_hschlag_timestamp;
clock_type::time_point last_hbeat_timestamp;
uint64_t failed_appends{0};
// The pair of sequences used to track append entries requests sent and
// received by the follower. Every time append entries request is created
Expand Down

0 comments on commit 7ff2d7c

Please sign in to comment.