Skip to content

Commit

Permalink
Merge pull request #5801 from devillove084/fix_subscribe_metrics
Browse files Browse the repository at this point in the history
Remove subscribe_metrics todos.
  • Loading branch information
devillove084 authored Jun 6, 2022
2 parents 0b56384 + 49a9bd2 commit 9334eb9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions metasrv/src/meta_service/raftmeta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,11 @@ impl MetaNode {
// spawn a monitor to watch raft state changes such as leader changes,
// and manually add non-voter to cluster so that non-voter receives raft logs.
pub async fn subscribe_metrics(mn: Arc<Self>, mut metrics_rx: watch::Receiver<RaftMetrics>) {
//TODO: return a handle for join
// TODO: every state change triggers add_non_voter!!!
// TODO(luhuanbing): every state change triggers add_non_voter is not very reasonable
let mut running_rx = mn.running_rx.clone();
let mut jh = mn.join_handles.lock().await;
let mut current_leader: Option<u64> = None;

// TODO: reduce dependency: it does not need all of the fields in MetaNode
let mn = mn.clone();

let span = tracing::span!(tracing::Level::INFO, "watch-metrics");
Expand Down Expand Up @@ -394,7 +392,6 @@ impl MetaNode {
}

if cur == mn.sto.id {
// TODO: check result
let _rst = mn.add_configured_non_voters().await;

if _rst.is_err() {
Expand Down

0 comments on commit 9334eb9

Please sign in to comment.