-
Notifications
You must be signed in to change notification settings - Fork 759
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
refactor: improve raft connection and logging filter #15801
Conversation
Only reuse a connection if there is no error returned from the last RPC. When a raft RPC is finished, push the connection back for next RPC if it returns an `Ok`. Otherwise it drops the connection and the next RPC will re-create a new one. Such approach ensures no problematic connection will be used. Support multi log prefix filter.
} | ||
|
||
fn match_prefix_many(meta: &Metadata, prefixes: &[String]) -> bool { | ||
if is_severe(meta) { |
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.
is it typo?
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.
No, warning and error logs are considered severe, is there better term for 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.
ok. I think it's fine.
back_off_min_delay: Duration::from_secs(1), | ||
back_off_max_delay: Duration::from_secs(60), | ||
back_off_chances: 3, | ||
back_off_ratio: 1.5, |
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.
are these params configuable?
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.
Not yet.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
refactor: improve raft connection and logging filter
Only reuse a connection if there is no error returned from the last RPC.
When a raft RPC is finished, push the connection back for next RPC if it
returns an
Ok
. Otherwise it drops the connection and the next RPC willre-create a new one. Such approach ensures no problematic connection
will be used.
Support multi log prefix filter.
Tests
Type of change
Related Issues
This change is