Skip to content

Commit 29e8b72

Browse files
committed
Doc: fix typos
1 parent 4bc7242 commit 29e8b72

File tree

25 files changed

+50
-46
lines changed

25 files changed

+50
-46
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ lint:
5353
# Thus we only check unused deps for lib
5454
RUSTFLAGS=-Wunused-crate-dependencies cargo clippy --lib -- -D warnings
5555

56+
typos:
57+
# cargo install typos-cli
58+
typos
59+
5660
clean:
5761
cargo clean
5862

change-log.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
Otherwise the application receives updated metrics while the internal raft
4545
state is still stale.
4646

47-
- Fixed: [59ddc982](https://github.com/datafuselabs/openraft/commit/59ddc982100a390efd66632adbf25edd2c6e6a3c) avoid creating log-id with unitialized `matched.leader_id`.; by 张炎泼; 2022-07-26
47+
- Fixed: [59ddc982](https://github.com/datafuselabs/openraft/commit/59ddc982100a390efd66632adbf25edd2c6e6a3c) avoid creating log-id with uninitialized `matched.leader_id`.; by 张炎泼; 2022-07-26
4848

4949
When waiting for a newly added learner to become up to date,
5050
it tries to compare last-log-id and the reported `matched` replication
5151
state.
5252
But the `matched` may have not yet receive any update and is
53-
unitialized, in such case, it tries to create a temp LogId with
53+
uninitialized, in such case, it tries to create a temp LogId with
5454
`leader_id(0, 0)`, which is illegal.
5555

5656
The fix is simple: do not use log-id. Just calculating replication lag by log index.
@@ -236,7 +236,7 @@
236236

237237
- Changed: [f40c2055](https://github.com/datafuselabs/openraft/commit/f40c205532b4e75384a6eaaebb601447001d13f4) Add a `RaftTypeConfig` trait to configure common types; by Ivan Schréter; 2022-02-25
238238

239-
- Changed: [650e2352](https://github.com/datafuselabs/openraft/commit/650e23524b759219b9dea0d2fbe3e71859429115) Membership remove redundent field `learners`: the node ids that are in `Membership.nodes` but not in `Membership.configs` are learners; by 张炎泼; 2022-03-07
239+
- Changed: [650e2352](https://github.com/datafuselabs/openraft/commit/650e23524b759219b9dea0d2fbe3e71859429115) Membership remove redundant field `learners`: the node ids that are in `Membership.nodes` but not in `Membership.configs` are learners; by 张炎泼; 2022-03-07
240240

241241
- Changed: [81cd3443](https://github.com/datafuselabs/openraft/commit/81cd3443530a9ef260ded00f0a8b2825cefe8196) EffectiveMembership.log_id to Option<LogId>; by 张炎泼; 2022-04-05
242242

@@ -588,7 +588,7 @@
588588

589589
API changes:
590590

591-
- Removes `allow_lagging` paramenter from `Raft::change_membership()`
591+
- Removes `allow_lagging` parameter from `Raft::change_membership()`
592592
- Removes error `LearnerIsLagging`
593593

594594
Upgrade tip:
@@ -648,7 +648,7 @@
648648

649649
### Added:
650650

651-
- Added: [966eb287](https://github.com/datafuselabs/openraft/commit/966eb287ff9bc98112b7b5d69253cca2d86277f8) use a version to track metics change; by 张炎泼; 2022-03-03
651+
- Added: [966eb287](https://github.com/datafuselabs/openraft/commit/966eb287ff9bc98112b7b5d69253cca2d86277f8) use a version to track metrics change; by 张炎泼; 2022-03-03
652652

653653
Add `Versioned<D>` to track changes of an `Arc<D>`.
654654

@@ -1380,7 +1380,7 @@
13801380
13811381
- R0 to R1 `append_entries: entries=[{1,2}], prev_log_id = {1,1}, commit_index = 3`
13821382
- R1 accepted this `append_entries` request but was not aware of that entry {2,3} is inconsistent to leader.
1383-
Updating commit index to 3 allows it to apply an uncommitted entrie `{2,3}`.
1383+
Updating commit index to 3 allows it to apply an uncommitted entries `{2,3}`.
13841384
13851385
## v0.6.2-alpha.15
13861386
@@ -1482,15 +1482,15 @@
14821482
14831483
A membership change involves two steps: the joint config phase and the
14841484
final config phase.
1485-
Each phase has a corresponding log invovled.
1485+
Each phase has a corresponding log involved.
14861486
14871487
Previously the raft setup several channel to organize this workflow,
14881488
which makes the logic hard to understand and introduces complexity when
1489-
restarting or leadership transfered: it needs to re-establish the channels and tasks.
1489+
restarting or leadership transferred: it needs to re-establish the channels and tasks.
14901490
14911491
According to the gist of raft, all workflow should be log driven.
14921492
Thus the new approach:
1493-
- Write two log(the joint and the final) at once it recevies a
1493+
- Write two log(the joint and the final) at once it receives a
14941494
change-membership request.
14951495
- All following job is done according to just what log is committed.
14961496
@@ -1546,7 +1546,7 @@
15461546
logs to get the last membership that is included in state machine.
15471547
15481548
By letting the state machine remember the membership log applied,
1549-
the snapshto creation becomes more convinient and intuitive: it does not
1549+
the snapshto creation becomes more convenient and intuitive: it does not
15501550
need to scan the applied logs any more.
15511551
15521552
## v0.6.2-alpha.7
@@ -1609,7 +1609,7 @@
16091609
a container of metadata of a snapshot.
16101610
Reduce parameters.
16111611
1612-
- Refactor: remove redundent param `delete_through` from
1612+
- Refactor: remove redundant param `delete_through` from
16131613
`finalize_snapshot_installation`.
16141614
16151615
## v0.6.2-alpha.4
@@ -1812,7 +1812,7 @@
18121812
- Simplify CI test: test all in one action.
18131813

18141814
- Disable clippy: it suggests inappropriate assert_eq to assert
1815-
convertion which is used in a macro.
1815+
conversion which is used in a macro.
18161816

18171817
- Add makefile
18181818

change-log/v0.6.2-alpha.10.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
A membership change involves two steps: the joint config phase and the
2020
final config phase.
21-
Each phase has a corresponding log invovled.
21+
Each phase has a corresponding log involved.
2222

2323
Previously the raft setup several channel to organize this workflow,
2424
which makes the logic hard to understand and introduces complexity when
25-
restarting or leadership transfered: it needs to re-establish the channels and tasks.
25+
restarting or leadership transferred: it needs to re-establish the channels and tasks.
2626

2727
According to the gist of raft, all workflow should be log driven.
2828
Thus the new approach:
29-
- Write two log(the joint and the final) at once it recevies a
29+
- Write two log(the joint and the final) at once it receives a
3030
change-membership request.
3131
- All following job is done according to just what log is committed.
3232

change-log/v0.6.2-alpha.16.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@
109109
110110
- R0 to R1 `append_entries: entries=[{1,2}], prev_log_id = {1,1}, commit_index = 3`
111111
- R1 accepted this `append_entries` request but was not aware of that entry {2,3} is inconsistent to leader.
112-
Updating commit index to 3 allows it to apply an uncommitted entrie `{2,3}`.
112+
Updating commit index to 3 allows it to apply an uncommitted entries `{2,3}`.

change-log/v0.6.2-alpha.5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@
3838
a container of metadata of a snapshot.
3939
Reduce parameters.
4040
41-
- Refactor: remove redundent param `delete_through` from
41+
- Refactor: remove redundant param `delete_through` from
4242
`finalize_snapshot_installation`.

change-log/v0.6.2-alpha.8.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
logs to get the last membership that is included in state machine.
1818

1919
By letting the state machine remember the membership log applied,
20-
the snapshto creation becomes more convinient and intuitive: it does not
20+
the snapshto creation becomes more convenient and intuitive: it does not
2121
need to scan the applied logs any more.

change-log/v0.6.2-alpha.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
- Simplify CI test: test all in one action.
6666

6767
- Disable clippy: it suggests inappropriate assert_eq to assert
68-
convertion which is used in a macro.
68+
conversion which is used in a macro.
6969

7070
- Add makefile
7171

change-log/v0.8.0.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
Otherwise the application receives updated metrics while the internal raft
3737
state is still stale.
3838

39-
- Fixed: [59ddc982](https://github.com/datafuselabs/openraft/commit/59ddc982100a390efd66632adbf25edd2c6e6a3c) avoid creating log-id with unitialized `matched.leader_id`.; by 张炎泼; 2022-07-26
39+
- Fixed: [59ddc982](https://github.com/datafuselabs/openraft/commit/59ddc982100a390efd66632adbf25edd2c6e6a3c) avoid creating log-id with uninitialized `matched.leader_id`.; by 张炎泼; 2022-07-26
4040

4141
When waiting for a newly added learner to become up to date,
4242
it tries to compare last-log-id and the reported `matched` replication
4343
state.
4444
But the `matched` may have not yet receive any update and is
45-
unitialized, in such case, it tries to create a temp LogId with
45+
uninitialized, in such case, it tries to create a temp LogId with
4646
`leader_id(0, 0)`, which is illegal.
4747

4848
The fix is simple: do not use log-id. Just calculating replication lag by log index.
@@ -228,7 +228,7 @@
228228

229229
- Changed: [f40c2055](https://github.com/datafuselabs/openraft/commit/f40c205532b4e75384a6eaaebb601447001d13f4) Add a `RaftTypeConfig` trait to configure common types; by Ivan Schréter; 2022-02-25
230230

231-
- Changed: [650e2352](https://github.com/datafuselabs/openraft/commit/650e23524b759219b9dea0d2fbe3e71859429115) Membership remove redundent field `learners`: the node ids that are in `Membership.nodes` but not in `Membership.configs` are learners; by 张炎泼; 2022-03-07
231+
- Changed: [650e2352](https://github.com/datafuselabs/openraft/commit/650e23524b759219b9dea0d2fbe3e71859429115) Membership remove redundant field `learners`: the node ids that are in `Membership.nodes` but not in `Membership.configs` are learners; by 张炎泼; 2022-03-07
232232

233233
- Changed: [81cd3443](https://github.com/datafuselabs/openraft/commit/81cd3443530a9ef260ded00f0a8b2825cefe8196) EffectiveMembership.log_id to Option<LogId>; by 张炎泼; 2022-04-05
234234

@@ -580,7 +580,7 @@
580580

581581
API changes:
582582

583-
- Removes `allow_lagging` paramenter from `Raft::change_membership()`
583+
- Removes `allow_lagging` parameter from `Raft::change_membership()`
584584
- Removes error `LearnerIsLagging`
585585

586586
Upgrade tip:
@@ -640,7 +640,7 @@
640640

641641
### Added:
642642

643-
- Added: [966eb287](https://github.com/datafuselabs/openraft/commit/966eb287ff9bc98112b7b5d69253cca2d86277f8) use a version to track metics change; by 张炎泼; 2022-03-03
643+
- Added: [966eb287](https://github.com/datafuselabs/openraft/commit/966eb287ff9bc98112b7b5d69253cca2d86277f8) use a version to track metrics change; by 张炎泼; 2022-03-03
644644

645645
Add `Versioned<D>` to track changes of an `Arc<D>`.
646646

examples/raft-kv-memstore/src/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl ExampleClient {
6565

6666
/// Consistent Read value by key, in an inconsistent mode.
6767
///
68-
/// This method MUST return consitent value or CheckIsLeaderError.
68+
/// This method MUST return consistent value or CheckIsLeaderError.
6969
pub async fn consistent_read(&self, req: &String) -> Result<String, typ::RPCError<typ::CheckIsLeaderError>> {
7070
self.do_send_rpc_to_leader("consistent_read", Some(req)).await
7171
}

examples/raft-kv-memstore/src/store/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub enum ExampleRequest {
4646
* In this example it will return a optional value from a given key in
4747
* the `ExampleRequest.Set`.
4848
*
49-
* TODO: SHould we explain how to create multiple `AppDataResponse`?
49+
* TODO: Should we explain how to create multiple `AppDataResponse`?
5050
*
5151
*/
5252
#[derive(Serialize, Deserialize, Debug, Clone)]

examples/raft-kv-rocksdb/src/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl ExampleClient {
7474

7575
/// Consistent Read value by key, in an inconsistent mode.
7676
///
77-
/// This method MUST return consitent value or CheckIsLeaderError.
77+
/// This method MUST return consistent value or CheckIsLeaderError.
7878
pub async fn consistent_read(
7979
&self,
8080
req: &String,

examples/raft-kv-rocksdb/src/store.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub enum ExampleRequest {
5555
* In this example it will return a optional value from a given key in
5656
* the `ExampleRequest.Set`.
5757
*
58-
* TODO: SHould we explain how to create multiple `AppDataResponse`?
58+
* TODO: Should we explain how to create multiple `AppDataResponse`?
5959
*
6060
*/
6161
#[derive(Serialize, Deserialize, Debug, Clone)]
@@ -390,7 +390,7 @@ impl RaftSnapshotBuilder<ExampleTypeConfig, Cursor<Vec<u8>>> for Arc<ExampleStor
390390
last_membership = state_machine.last_membership;
391391
}
392392

393-
// TODO: we probably want thius to be atomic.
393+
// TODO: we probably want this to be atomic.
394394
let snapshot_idx: u64 = self.get_snapshot_index_()? + 1;
395395
self.set_snapshot_indesx_(snapshot_idx)?;
396396

guide/src/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- Q: 🤔 Why is heartbeat an append-entries RPC with a blank log in openraft, while standard Raft uses empty append-entries?
44

5-
Chapter [Heartbeat](./heartbeat.md) explains the benifit of the heartbeat-log design.
5+
Chapter [Heartbeat](./heartbeat.md) explains the benefit of the heartbeat-log design.
66

77
- Q: 🤔 Why is log id `(term, node_id, log_index)`, while standard Raft uses just
88
`(term, log_index)`?

guide/src/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this chapter we are going to build a key-value store cluster with [openraft](
66
is the complete example application including the server, the client and a demo cluster.
77

88
[examples/raft-kv-rocksdb](https://github.com/datafuselabs/openraft/tree/main/examples/raft-kv-rocksdb)
9-
is the complete example application including the server, the client and a demo cluster using rocksdb for persistant storage.
9+
is the complete example application including the server, the client and a demo cluster using rocksdb for persistent storage.
1010

1111
---
1212

guide/src/upgrade-v07-v08.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Openraft v0.8 can be compatible with v0.7 if:
6565
- Enabling `compat-07` feature flags.
6666

6767
Openraft uses a `RaftStorage` implementation provided by the application to
68-
store presistent data. When upgrading from v0.7 to v0.8, it is important to
68+
store persistent data. When upgrading from v0.7 to v0.8, it is important to
6969
ensure that the updated `RaftStorage` is backward compatible and can read the
7070
data written by v0.7 openraft, in addition to reading and writing v0.8 openraft data.
7171
This ensures that the application continues to function smoothly after upgrade.

openraft/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ serde = ["dep:serde"]
7777
# This feature is disabled by default.
7878
single-term-leader = []
7979

80-
# Provide basic compatbile types
80+
# Provide basic compatible types
8181
compat = []
8282

83-
# Turn on to let openraft provide addtional data types to build v0.7 compatible RaftStorage.
83+
# Turn on to let openraft provide additional data types to build v0.7 compatible RaftStorage.
8484
compat-07 = ["compat", "serde", "dep:or07", "compat-07-testing"]
8585
compat-07-testing = ["dep:tempfile", "anyhow", "dep:serde_json"]
8686

openraft/src/defensive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ where
137137
Ok(())
138138
}
139139

140-
/// Trying to feed in emtpy entries slice is an inappropriate action.
140+
/// Trying to feed in empty entries slice is an inappropriate action.
141141
///
142142
/// The impl has to avoid this otherwise it may be a bug.
143143
async fn defensive_nonempty_input(&self, entries: &[&Entry<C>]) -> Result<(), StorageError<C::NodeId>> {
@@ -235,7 +235,7 @@ where
235235
Ok(())
236236
}
237237

238-
/// The entries to apply to state machien has to be last_applied_log_id.index + 1
238+
/// The entries to apply to state machine has to be last_applied_log_id.index + 1
239239
async fn defensive_apply_index_is_last_applied_plus_one(
240240
&mut self,
241241
entries: &[&Entry<C>],

openraft/src/engine/handler/leader_handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ mod tests {
736736
target: 2,
737737
req: Inflight::logs(None, Some(log_id(3, 6))).with_id(1),
738738
},
739-
// It is correct to commit if the membership change ot a one node cluster.
739+
// It is correct to commit if the membership change to a one node cluster.
740740
Command::ReplicateCommitted {
741741
committed: Some(log_id(3, 6))
742742
},

openraft/src/membership/membership_state.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ where
155155
/// It returns the updated effective membership config if it is changed.
156156
///
157157
/// It will reset `self.effective` to `self.committed`. Only the effective could be truncated,
158-
/// when a new leader tries ot truncate follower logs that the leader does not have.
158+
/// when a new leader tries to truncate follower logs that the leader does not have.
159159
///
160160
/// If the effective membership is from a conflicting log,
161161
/// the membership state has to revert to the last committed membership config.

openraft/src/raft.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ impl<NID: NodeId> VoteRequest<NID> {
11271127
#[derive(Debug, Clone, PartialEq, Eq)]
11281128
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize), serde(bound = ""))]
11291129
pub struct VoteResponse<NID: NodeId> {
1130-
/// vote after a node handling vote-reqest.
1130+
/// vote after a node handling vote-request.
11311131
/// Thus `resp.vote >= req.vote` always holds.
11321132
pub vote: Vote<NID>,
11331133

openraft/src/testing/suite.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::Vote;
3333

3434
const NODE_ID: u64 = 0;
3535

36-
/// Helper to consturct a `BTreeSet` of `C::NodeId` from numbers.
36+
/// Helper to construct a `BTreeSet` of `C::NodeId` from numbers.
3737
macro_rules! btreeset {
3838
($($key:expr,)+) => (btreeset!($($key),+));
3939
( $($key:expr),* ) => {{

openraft/src/vote/leader_id/leader_id_adv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ mod tests {
7373
use crate::LeaderId;
7474

7575
#[test]
76-
fn test_commited_leader_id_serde() -> anyhow::Result<()> {
76+
fn test_committed_leader_id_serde() -> anyhow::Result<()> {
7777
let c = CommittedLeaderId::<u32>::new(5, 10);
7878
let s = serde_json::to_string(&c)?;
7979
assert_eq!(r#"{"term":5,"node_id":10}"#, s);

openraft/src/vote/leader_id/leader_id_std.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mod tests {
104104
use crate::LeaderId;
105105

106106
#[test]
107-
fn test_commited_leader_id_serde() -> anyhow::Result<()> {
107+
fn test_committed_leader_id_serde() -> anyhow::Result<()> {
108108
let c = CommittedLeaderId::<u32>::new(5, 10);
109109
let s = serde_json::to_string(&c)?;
110110
assert_eq!(r#"5"#, s);

rocksstore/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub enum RocksRequest {
6363
* In this example it will return a optional value from a given key in
6464
* the `RocksRequest.Set`.
6565
*
66-
* TODO: SHould we explain how to create multiple `AppDataResponse`?
66+
* TODO: Should we explain how to create multiple `AppDataResponse`?
6767
*
6868
*/
6969
#[derive(Serialize, Deserialize, Debug, Clone)]

sledstore/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub enum ExampleRequest {
5656
* In this example it will return a optional value from a given key in
5757
* the `ExampleRequest.Set`.
5858
*
59-
* TODO: SHould we explain how to create multiple `AppDataResponse`?
59+
* TODO: Should we explain how to create multiple `AppDataResponse`?
6060
*
6161
*/
6262
#[derive(Serialize, Deserialize, Debug, Clone)]
@@ -408,7 +408,7 @@ impl RaftLogReader<ExampleTypeConfig> for Arc<SledStore> {
408408
let logs = logs_tree
409409
.range::<&[u8], _>(start.as_slice()..)
410410
.map(|el_res| {
411-
let el = el_res.expect("Faile read log entry");
411+
let el = el_res.expect("Failed read log entry");
412412
let id = el.0;
413413
let val = el.1;
414414
let entry: StorageResult<Entry<_>> = serde_json::from_slice(&val).map_err(|e| StorageError::IO {
@@ -446,7 +446,7 @@ impl RaftSnapshotBuilder<ExampleTypeConfig, Cursor<Vec<u8>>> for Arc<SledStore>
446446
last_membership = state_machine.last_membership;
447447
}
448448

449-
// TODO: we probably want thius to be atomic.
449+
// TODO: we probably want this to be atomic.
450450
let snapshot_idx: u64 = self.get_snapshot_index_()? + 1;
451451
self.set_snapshot_index_(snapshot_idx).await?;
452452

0 commit comments

Comments
 (0)