@@ -301,13 +301,13 @@ by one:
301301 }
302302 ```
303303
304- Note, although Raft guarentees only persisted committed entries will be applied,
305- but it doesn't guarentee commit index is persisted before being applied. For example,
306- if application is restarted after applying committed entries before persisting
307- commit index, apply index can be larger than commit index and cause panic. To
308- solve the problem, persisting commit index with or before applying entries.
309- You can also always assign commit index to the `max(commit_index, applied_index)`
310- after restarting, *it may work but potential log loss may also be ignored silently*.
304+ Note, although Raft guarentees only persisted committed entries will be applied,
305+ but it doesn't guarentee commit index is persisted before being applied. For example,
306+ if application is restarted after applying committed entries before persisting
307+ commit index, apply index can be larger than commit index and cause panic. To
308+ solve the problem, persisting commit index with or before applying entries.
309+ You can also always assign commit index to the `max(commit_index, applied_index)`
310+ after restarting, *it may work but potential log loss may also be ignored silently*.
311311
3123124. Check whether `entries` is empty or not. If not empty, it means that there are newly added
313313 entries but have not been committed yet, we must append the entries to the Raft log:
@@ -425,7 +425,7 @@ above except:
4254251. All writes are not required to be persisted immediately, they can be written into memory caches;
4264262. Persisted messages should be sent after all corresponding writes are persisted;
4274273. [`advance_append_async`](RawNode::advance_append_async) is used when all writes are finished
428- instead of `advance/advance_append`.
428+ instead of `advance/advance_append`.
4294294. Only persisted entries can be committed and applied, so to make progress, all writes should
430430 be persisted at some point.
431431
@@ -585,7 +585,7 @@ pub fn default_logger() -> slog::Logger {
585585
586586 if let Some ( case) = std:: thread:: current ( )
587587 . name ( )
588- . and_then ( |v| v. split ( ':' ) . last ( ) )
588+ . and_then ( |v| v. split ( ':' ) . next_back ( ) )
589589 {
590590 logger. new ( o ! ( "case" => case. to_string( ) ) )
591591 } else {
0 commit comments