-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raftstore: add drop message metrics #2316
Conversation
src/raftstore/store/store.rs
Outdated
@@ -770,6 +770,7 @@ impl<T: Transport, C: PdClient> Store<T, C> { | |||
fn on_raft_message(&mut self, mut msg: RaftMessage) -> Result<()> { | |||
let region_id = msg.get_region_id(); | |||
if !self.is_raft_msg_valid(&msg) { | |||
self.raft_metrics.message.drop_invalid_msg += 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to drop the message? stale, store not match or others?
I think we should more detailed metric tags.
src/raftstore/store/local_metrics.rs
Outdated
@@ -88,6 +88,13 @@ pub struct RaftMessageMetrics { | |||
pub heartbeat_resp: u64, | |||
pub transfer_leader: u64, | |||
pub timeout_now: u64, | |||
pub drop_mismatch_store_id: u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer using another struct for these drop messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
PTAL @BusyJay
Add a new metrics for recording dropped messages
PTAL |
PTAL @javaforfun |
No need, here we just want to know the invalid message like stale, mismatched store ID, dropping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check_msg
and check_snapshot
is not covered.
src/raftstore/store/store.rs
Outdated
@@ -721,6 +723,7 @@ impl<T: Transport, C: PdClient> Store<T, C> { | |||
region_id, | |||
p | |||
); | |||
self.raft_metrics.message_dropped.destroy_stale_peer += 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as L695.
9a41c1d
to
60eb8e7
Compare
PTAL |
LGTM |
/run-all-test |
Records dropped raft messages. Please let me know if I am missing something.