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: ignore error when sending messages #4734
Conversation
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
/release |
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.
LGTM
have you ensured using this can avoid 1s latency jitter now? |
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
/release |
src/binutil/setup.rs
Outdated
@@ -31,10 +32,27 @@ pub fn initial_logger(config: &TiKvConfig) { | |||
let log_rotation_timespan = | |||
chrono::Duration::from_std(config.log_rotation_timespan.clone().into()) | |||
.expect("config.log_rotation_timespan is an invalid duration."); | |||
|
|||
// Collects following targets. | |||
const ENABLED_TARGETS: &[&str] = &[ |
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.
oh, seem now we have not filtered any message, right? @BusyJay
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.
Yes. And it's expected not to filter any messages. Here is just for debug purpose, will remove later.
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
18855b9
to
886aebc
Compare
/release |
src/raftstore/store/peer.rs
Outdated
@@ -838,6 +837,15 @@ impl Peer { | |||
"peer_id" => self.peer.get_id(), | |||
"lease" => ?self.leader_lease, | |||
); | |||
// If predecessor read index during transferring leader and received quorum's |
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.
PTAL @dcalvin
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.
// If predecessor read index during transferring leader and received quorum's | |
// If the predecessor read index receives quorum's heart response during |
/release |
src/raftstore/store/peer.rs
Outdated
@@ -911,6 +910,15 @@ impl Peer { | |||
"peer_id" => self.peer.get_id(), | |||
"lease" => ?self.leader_lease, | |||
); | |||
// If predecessor read index during transferring leader and received quorum's | |||
// heartbeat response, it may waiting for advancing apply to current term to |
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.
it may wait
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.
waiting for advancing apply to current term to apply the read.
What does "advancing apply to current term" mean? @BusyJay
// TODO: Maybe the predecessor should just drop all the read requests directly? | ||
// All the requests need to be redirected in the end anyway and executing | ||
// prewrites or commits will be just a waste. | ||
self.last_urgent_proposal_idx = self.raft_group.raft.raft_log.last_index(); |
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 test to cover it?
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
PTAL |
if filtered_msg.is_none() { | ||
*filtered_msg = Some(msg); | ||
} | ||
} else if msg.get_message().get_msg_type() == self.flush_type { |
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.
Doesn't not need to break
here?
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.
Following messages may still apply the rules, it may not be appropriate to break as a general filter.
@@ -2123,6 +2107,10 @@ impl Peer { | |||
} | |||
|
|||
pub fn get_peer_from_cache(&self, peer_id: u64) -> Option<metapb::Peer> { | |||
if peer_id == 0 { |
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.
Why add it?
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.
When there is no leader, peer_id
may be 0 as it represents leader id. Add a check to skip slow path.
LGTM. |
/run-integration-tests |
Signed-off-by: qupeng <qupeng@pingcap.com>
Signed-off-by: Jay <BusyJay@users.noreply.github.com>
What have you changed? (mandatory)
Fix #4717, I'm still trying to write a test case to reproduce it reliably.
What are the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
manual tests
Does this PR affect documentation (docs) or release note? (mandatory)
No.
Does this PR affect tidb-ansible update? (mandatory)
No.
Refer to a related PR or issue link (optional)
#4717