Skip to content

Commit da391be

Browse files
committed
Doc: FAQ: use Unreachable to alleviate error log flooding
1 parent ae0d657 commit da391be

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

openraft/src/docs/faq/faq-toc.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* [What are the differences between Openraft and standard Raft?](#what-are-the-differences-between-openraft-and-standard-raft)
33
- [Data structure](#data-structure)
44
* [Why is log id a tuple of `(term, node_id, log_index)`?](#why-is-log-id-a-tuple-of-term-node_id-log_index)
5+
- [Replication](#replication)
6+
* [How to minimize error logging when a follower is offline](#how-to-minimize-error-logging-when-a-follower-is-offline)
57
- [Cluster management](#cluster-management)
68
* [How to initialize a cluster?](#how-to-initialize-a-cluster)
79
* [Are there any issues with running a single node service?](#are-there-any-issues-with-running-a-single-node-service)

openraft/src/docs/faq/faq.md

+14
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ This way in every term there could be more than one leaders elected, and the las
1919
See: [`leader-id`](`crate::docs::data::leader_id`) for details.
2020

2121

22+
## Replication
23+
24+
25+
### How to minimize error logging when a follower is offline
26+
27+
Excessive error logging, like `ERROR openraft::replication: 248: RPCError err=NetworkError: ...`, occurs when a follower node becomes unresponsive. To alleviate this, implement a mechanism within [`RaftNetwork`][] that returns a [`Unreachable`][] error instead of a [`NetworkError`][] when immediate replication retries to the affected node are not advised.
28+
2229

2330
## Cluster management
2431

@@ -98,7 +105,14 @@ pub(crate) fn following_handler(&mut self) -> FollowingHandler<C> {
98105

99106
[`leader_id`]: `crate::docs::data::leader_id`
100107

108+
[`RaftNetwork`]: `crate::network::RaftNetwork`
109+
101110
[`add_learner()`]: `crate::Raft::add_learner`
102111
[`change_membership()`]: `crate::Raft::change_membership`
103112

104113
[`Membership`]: `crate::Membership`
114+
115+
[`Unreachable`]: `crate::error::Unreachable`
116+
[`NetworkError`]: `crate::error::NetworkError`
117+
118+

0 commit comments

Comments
 (0)