Commit Graph

199 Commits

Author SHA1 Message Date
Anthony Dodd bcc246ccf8
Add a pull request template. 2021-05-26 21:15:26 -05:00
Anthony Dodd 3388f1a275
Add link to discord server. 2021-05-21 16:54:41 -05:00
Anthony Dodd 3dce97c5a4
Updates for v0.6.1 release. 2021-05-18 22:47:27 -05:00
张炎泼 9ecaf931e0
fix: a NonVoter should stay as NonVoter instead of Follower after restart (#114)
* fix: a NonVoter should stay as NonVoter instead of Follower after restart

Co-authored-by: Anthony Dodd <Dodd.AnthonyJosiah@gmail.com>
2021-05-18 22:43:26 -05:00
linsinn 5f2567b7cc
Fix bug in replica counting
This fix ensures that counting of replicas to determine a new commit value only considers entries replicated as part of the current term.

closes #108 

Co-authored-by: Anthony Dodd <Dodd.AnthonyJosiah@gmail.com>
2021-05-18 21:57:44 -05:00
iamazy 2d51ebcbf0
Add else condition in function set_target_state (#107)
closes #105
2021-05-18 20:32:32 -05:00
Anthony Dodd cdbaba3a02
Fix a few clippy issues. 2021-05-18 20:30:40 -05:00
Anthony Dodd fcd88335a2
Small tweak to deps post releases. 2021-01-21 08:04:01 -06:00
Anthony Dodd cf823a1dc3
Prep for async-raft@0.6.0 & memstore@0.2.0 releases. 2021-01-20 22:56:57 -06:00
Anthony Dodd 0af8f72f97
Merge pull request #94 from xu-cheng/tokio
Update Tokio to 1.0
2021-01-20 22:16:21 -06:00
Anthony Dodd 3d0cac739c
Merge branch 'master' into tokio 2021-01-20 21:48:24 -06:00
Anthony Dodd 26d3a7de7f
Update changelog related to debug bounds. 2021-01-20 08:38:40 -06:00
Anthony Dodd 01b6a60098
Merge pull request #89 from xu-cheng/remove-debug-bound
Avoid requiring Debug bound for AppData and AppDataResponse
2021-01-20 08:37:20 -06:00
Cheng XU 22caeebc8c
Update Tokio to 1.0 2021-01-20 06:26:13 -08:00
Anthony Dodd 55cd0c8f9c
Merge branch 'master' into remove-debug-bound 2021-01-20 08:26:04 -06:00
Anthony Dodd 5e43d16748
Update client_current_leader -> current_leader & add test to CI.
Updated changelog to describe the changes.
2021-01-20 08:23:23 -06:00
Anthony Dodd 411bd81ef5
Merge pull request #99 from xu-cheng/leader-api
Add client_current_leader API
2021-01-20 08:14:52 -06:00
Anthony Dodd ade78ae510
Merge branch 'master' into leader-api 2021-01-20 08:06:28 -06:00
Anthony Dodd cd3eb346f4
Merge pull request #102 from async-raft/98-race-condition-for-heartbeats-and-client-read
Ensure heartbeats are never processed by log consistency algorithm
2021-01-20 08:02:44 -06:00
Anthony Dodd 5be81dbfc2
Ensure heartbeats are never processed for log consistency.
closes #98
2021-01-20 07:53:40 -06:00
Anthony Dodd 5ca6f8d1cf
Update docs on RaftStorage::Snapshot usage.
closes #93
2021-01-17 09:38:07 -06:00
Anthony Dodd e26d6ab423
Merge pull request #92 from async-raft/client-error-ergonomics-2
Improve ergonomics of client write error handling - take 2.
2021-01-17 09:27:06 -06:00
Anthony Dodd 2ede56fb38
Improve startup semantics for recovered/restarted nodes.
This adds `30s + rand_election_timeout` to a node's initial
next_election_timeout when the node has recovered state after a restart.
This helps to ensure that the node does not trigger a new election and
begin driving up the Raft term before it can even properly communicate
with peers.

Fixed a few clippy lints.
2021-01-17 09:17:24 -06:00
Anthony Dodd 886f46dbe0
Improve ergonomics of client write error handling.
This is a farily minimal changeset, but is a breaking change.
This introduces a `RaftStorage::ShutdownError` associated type.
This allows for the Raft system to differentiate between fatal storage
errors which should cause the system to shutdown vs errors which should
be propagated back to the client for application specific error handling.
These changes only apply to the
`RaftStorage::apply_entry_to_state_machine` method.

Overall, this constitutes a nice improvement to the RaftStorage
interface, as a flat result type may be used for propagating errors. No
result nesting required.
2021-01-17 09:08:42 -06:00
Anthony Dodd 820a3f356f
Merge pull request #95 from xu-cheng/clippy
Update Clippy CI
2021-01-17 09:07:49 -06:00
Cheng XU 81ecede1d4
Add client_current_leader API
Closes #97.
2021-01-04 19:27:05 -08:00
Cheng XU 860e0f3b03
Use stable rust for all CI jobs 2020-12-29 15:34:46 -08:00
Cheng XU d97e265cc8
Update Clippy CI
- Use https://github.com/actions-rs/clippy-check action for better reporting.
- Run clippy with latest stable Rust instead of old version
- Run clippy against all targets including test cases.
2020-12-23 23:01:02 -08:00
Anthony Dodd db7365a42c
Merge pull request #90 from async-raft/clonable-raft-handle
Make the Raft handle clonable.
2020-12-01 22:01:45 -06:00
Anthony Dodd af3d191ed3
Prep for alpha.1 release. 2020-11-30 10:33:45 -06:00
Anthony Dodd 9e5a802727
Update the forwarding error to expose internal data.
Without this, the client write error forwarding system is mostly
useless. Simple update.
2020-11-29 17:31:33 -06:00
Cheng XU d217c2038c
Avoid requiring Debug bound for AppData and AppDataResponse 2020-11-28 22:57:49 -08:00
Anthony Dodd 23156fe019
Make the Raft handle clonable.
This is especially needed for cases where interaction with Raft from the
parent app needs to spawn a task for interacting with Raft. This makes
the interface a bit more flexible overall.
2020-11-28 23:48:30 -06:00
Anthony Dodd 74e81aaa4f
Update guide. 2020-11-24 14:49:56 -06:00
Anthony Dodd fb437324ae
Update memstore to 0.2.0-alpha.0 & release. 2020-11-24 13:04:29 -06:00
Anthony Dodd 5835bf4fc6
Merge pull request #88 from async-raft/12-cache-replicated-entries-and-dont-block
Cache replicated entries & don't block main task w/ replication
2020-11-24 09:46:04 -06:00
Anthony Dodd 57f49cc549
Updates to the log compaction interface.
The log index provided to the log compaction interface was a bit
misleading. When performing log compaction, the compaction can only
cover the breadth of the log up to the last applied log (obvs) and under
write load, this value may change quickly. As such, the expectations of
the log compaction interface have been refined and clarified.

Now, the only expectation is that the storage implementation will
export/checkpoint/snapshot its state machine, and then use the value of
that export's last applied log as the metadata indicating the breadth of
the log covered by the snapshot.
2020-11-24 09:32:33 -06:00
Anthony Dodd 1441e7b3ce
Prep for 0.5.6 release. 2020-11-19 20:26:40 -06:00
Anthony Dodd 7db81f71aa
Move state machine replication off of AppendEntries RPC path.
With this change, we are also caching entries which come from the leader
replication protocol. As entries come in, we append them to the log and
then cache the entry. When it is safe to apply entries to the state
machine, we will take them directly from the in-memory cache instead of
going to disk.

Moreover, and most importantly, we are not longer blocking the
AppendEntries RPC handler with the logic of the state machine
replication workflow. There is a small amount of async task juggling to
ensure that we don't run into situations where we would have two writers
attempting to write to the state machine at the same time. This is
easily avoided in our algorithm.

closes #12
closes #76
2020-11-19 18:59:31 -06:00
Anthony Dodd f5f9a415e3
Merge pull request #84 from sunli829/metrics-serialize
implements serialize and deserialize for RaftMetrics.
2020-11-08 12:13:22 -06:00
Sunli 302d3e54fe implements serialize and deserialize for RaftMetrics. 2020-11-07 10:37:38 +08:00
Anthony Dodd ea6f1c2020
Merge pull request #83 from async-raft/82-client-read-single-node
Fix a bug related to client read requests for a single node cluster.
2020-11-05 09:40:00 -06:00
Anthony Dodd 3e2446f717
Fix a bug related to client read requests for a single node cluster.
closes #82
2020-11-05 09:22:11 -06:00
Anthony Dodd fa56ee7d18
Merge pull request #81 from async-raft/79-the-real-fix
Round two on fixing #79
2020-11-05 07:46:21 -06:00
Anthony Dodd 3f47347c71
Round two on fixing #79
Added some tests to verify the fix and guard against regressions.

closes #79
2020-11-04 23:03:32 -06:00
Anthony Dodd f308f8c255
Merge pull request #80 from async-raft/79-fix-shutdown-routine
Ensure the shutdown routine properly updates Raft core state.
2020-11-04 13:36:58 -06:00
Anthony Dodd 926e286020
Ensure the shutdown routine properly updates Raft core state.
closes #79
2020-11-04 12:10:34 -06:00
Anthony Dodd c0da074509
Release CI workflows should use draft releases. 2020-10-06 07:45:10 -05:00
Anthony Dodd c2a74ad8b0
Small fix to release CI. 2020-10-05 23:19:19 -05:00
Anthony Dodd 0900e9ede8
Merge pull request #75 from async-raft/ci-fmt-clippy
Prep for 0.5.1 release.
2020-10-05 23:17:05 -05:00