fix(deps): update rust crate openraft to 0.9.0 #39
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
renovate-bot
renovate-security
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mCaptcha/dcache#39
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/openraft-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.8.8
->0.9.0
Release Notes
datafuselabs/openraft (openraft)
v0.9.17
Compare Source
Summary:
Copy
bound fromNodeId
.Detail:
Improved:
Improved: 536a435e Chunk read log entry and check range on startup; by 张炎泼; 2024-09-14
Implement chunk-based reading of committed log entries when
re-applying to state machine upon startup.
Add validation for log entry indexes, to avoid applying wrong entries
to state machine.
Improved: dc18dc6f remove
Copy
bound fromNodeId
; by 张炎泼; 2024-10-14The
NodeId
type is currently defined as:This commit removes the
Copy
bound fromNodeId
.This modification will allow the use of non-
Copy
types asNodeId
,providing greater flexibility for applications that prefer
variable-length strings or other non-
Copy
types for nodeidentification.
This change maintain compatibility by updating derived
Copy
implementations with manual implementations:
v0.9.16
Compare Source
What's Changed
Raft::change_membership()
on uninitialized node by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/1243Full Changelog: https://github.com/datafuselabs/openraft/compare/v0.9.15...v0.9.16
v0.9.15
Compare Source
Summary:
vote
when seeing higher vote inRequestVote
response.TypeConfigExt
to simplifyRaftTypeConfig
Access.Detail:
Fixed:
Fixed: 0b1293f3 Should not update
vote
when seeing higher vote inRequestVote
response; by 张炎泼; 2024-07-04This commit addresses an issue in the vote updating mechanism during the
handling of
RequestVote
responses. Previously, encountering a highervote
in a response incorrectly led to an update of the localstate.vote
, which could break Raft consistency rules.Issue Description:
vote
seen in aRequestVote
response does not necessarilymean that the vote is granted. The local
state.vote
should only beupdated if the vote is actually granted, i.e., the responding node has
a higher
vote
and alast_log_id
that allows it to become a leader.Resolution:
state.vote
will no longer be updated upon merely seeing ahigher
vote
in theRequestVote
response. Instead, this higher votewill be recorded in
last_seen_vote
for consideration in the nextelection cycle, without updating the current
state.vote
.This bug is introduced in:
f0a9e34
Fixed: 94b1e843 Clarify that receiving an equal vote does not grant leadership.; by 张炎泼; 2024-08-28
A node's
vote
may be updated when a leader observes a higher vote.In such cases, the leader updates its local vote and steps down.
However, this vote update does not imply that the node accepts the
higher vote as valid for leadership, as it has not yet compared their
logs.
In this commit, re-enable
VoteResponse.vote_granted
to indicate a voteis granted.
This commit also fix:
Added:
Added: 5f5d7e9f Add
TypeConfigExt
to simplifyRaftTypeConfig
Access; by 张炎泼; 2024-07-03This commit introduces a new trait,
TypeConfigExt
, which extendsRaftTypeConfig
. The purpose of this trait is to simplify the access tovarious functionalities provided by the
RaftTypeConfig
trait,enhancing code readability and reducing complexity.
Methods Added to
TypeConfigExt
:now()
sleep()
sleep_until()
timeout()
timeout_at()
oneshot()
spawn()
Usage Improvement:
<<C as RaftTypeConfig>::AsyncRuntime as AsyncRuntime>::Instant::now()
,you can now simply call
C::now()
.v0.9.14
Compare Source
v0.9.13
Compare Source
Summary:
DecomposeResult
to simplify error handling.Detail:
Added:
Added: fb49efb3 Add
DecomposeResult
to simplify error handling; by 张炎泼; 2024-06-20This commit treats remote errors occurring during RPC, like a
Fatal
error, as an
Unreachable
error. This is due to Openraft's currentinability to distinguish between an unreachable node and a broken node.
DecomposeResult
: Introduced to simplify handlingcomposite errors. It converts a result of the
form
Result<R, ErrorAOrB>
into a nested result
Result<Result<R, ErrorA>, ErrorB>
.v0.9.12
Compare Source
Summary:
RaftLogReader::limited_get_log_entries()
.Detail:
DocFixed:
Added:
Added: 8cd00388 Add
RaftLogReader::limited_get_log_entries()
; by 张炎泼; 2024-06-16This commit adds the
RaftLogReader::limited_get_log_entries()
method,which enables applications to fetch log entries that are equal to or
smaller than a specified range. This functionality is particularly
useful for customizing the size of AppendEntries requests at the storage
API level.
Applications can now decide the number of log entries to return based
on the input range. If the application determines that the requested
log entries range is too large for a single RPC, it can opt to return
only the first several requested log entries instead of the full
range.
The method provides a default implementation that delegates the
operation to
RaftLogReader::try_get_log_entries
.This enhancement allows for more flexible and efficient handling of log
entries, particularly in scenarios where network constraints or
performance considerations require smaller data transfers.
v0.9.11
Compare Source
Summary:
Detail:
Fixed:
Fixed: 30cdf5fb New leader must flush blank log; by 张炎泼; 2024-05-14
This commit addresses a critical issue where if a new leader does not
flush the blank log to disk upon becoming established and then restarts
immediately, there is a possibility that previously committed data
becomes invisible to readers.
Before the blank log is flushed, the leader (identified by vote
v3
)assumes it will be flushed and commits this log once (|quorum|-1)
replication responses are received. If the blank log is lost and the
server is restarted, data committed by a new leader (vote
v2
) maynot be visible.
This issue is addressed by utilizing
LeaderHandler::leader_append_entries()
instead of
ReplicationHandler::append_blank_log()
, where the formerdoes not wait for the blank log to flush.
Changes:
When assigning log IDs to log entries, the
Leading.last_log_id
,which represents the state of the log proposer (equivalent term in
Paxos is Proposer), should be used instead of
RaftState.last_log_id
,which represents the state of the log receiver (equivalent term in
Paxos is Acceptor).
Consequently, the method
assign_log_ids()
has been moved fromRaftState
toLeading
.Avoid manual implementation of duplicated logic:
During
initialize()
, reuseFollowingHandler::do_append_entries()
to submit the very first log to storage.
In
establish_leader()
, reuseLeaderHandler::leader_append_entries()
to submit log to storageand remove
ReplicationHandler::append_blank_log()
.Remove
Command::AppendEntry
.v0.9.10
Compare Source
Summary:
cancel
passed tofull_snapshot()
should bestatic
.Detail:
Improved:
cancel
passed tofull_snapshot()
should bestatic
; by 张炎泼; 2024-05-06v0.9.9
Compare Source
Summary:
Detail:
Fixed:
Fixed: 8b62c797 Immediate response when snapshot installation is unnecessary; by 张炎泼; 2024-05-05
When
Engine::handle_install_full_snapshot()
is called and the providedsnapshot is not up-to-date, the snapshot should not be installed, and
the response should be sent back immediately. Previously, the method
might delay the response unnecessarily, waiting for an installation
process that would not proceed.
This commit adjusts the logic so that if the snapshot is recognized as
outdated, it immediately returns a
None
Condition
, ensuring thecaller is informed straightaway that no installation will occur.
v0.9.8
Compare Source
Summary:
Chunked
should reset offset 0 when aSnapshotMismatch
error is received.Detail:
Fixed:
Fixed: fd5c657f
Chunked
should reset offset 0 when aSnapshotMismatch
error is received; by 张炎泼; 2024-05-02When a
SnapshotMismatch
is received, the sending end should re-sendall snapshot data from the beginning.
v0.9.7
Compare Source
Summary:
Detail:
Fixed:
v0.9.6
Compare Source
Summary:
#[since(version="1.0")]
to specify first version of a feature.expand!()
to expand a template.declare_raft_types
allows the types in any order.last_applied
, notlast_membership.index
on startup.Detail:
Added:
Added: 5776139d Add
#[since(version="1.0")]
to specify first version of a feature; by 张炎泼; 2024-04-12#[since(version = "1.0.0")]
adds a doc line/// Since: Version(1.0.0)
.Example:
The above code will be transformed into:
Added: b172dc8e Add macro
expand!()
to expand a template; by 张炎泼; 2024-04-13expand!()
renders a template with arguments multiple times.Example:
Improved:
Improved: 99596c75
declare_raft_types
allows the types in any order; by 张炎泼; 2024-04-13By rewriting the template expanding part with a
#[proc_macro]
expand!()
defined inopenraft_macros
,declare_raft_types
does not require the types in fixed order:
Example:
Fixed:
Fixed: 14d42e4f Load mebmership since
last_applied
, notlast_membership.index
on startup; by 张炎泼; 2024-04-25Modify
StorageHelper::last_membership_in_log()
to scan the logstarting from the last applied index rather than the index of the last
applied membership log. This change reduces unnecessary I/O operations
during startup, previously caused by scanning from an incorrect starting
point.
v0.9.5
Compare Source
Summary:
Raft::is_initialized()
.RaftTypeConfig::Responder
to customize returning client write response.Raft::client_write_ff()
ff for fire-and-forget.Detail:
Added:
Added: e4fed706 Add
Raft::is_initialized()
; by 张炎泼; 2024-04-08Raft::is_initialized()
returnstrue
if this raft node is alreadyinitialized with
Raft::initialize()
, by checking if log is empty andvote
is not written.Added: 3b18517a Add
RaftTypeConfig::Responder
to customize returning client write response; by 张炎泼; 2024-04-03This commit introduces the
Responder
trait that defines the mechanismby which
RaftCore
sends responses back to the client after processingwrite requests. Applications can now customize response handling by
implementing their own version of the
RaftTypeConfig::Responder
trait.The
Responder::from_app_data(RaftTypeConfig::D)
method is invoked tocreate a new
Responder
instance when a client write request isreceived.
Once the write operation is completed within
RaftCore
,Responder::send(WriteResult)
is called to dispatch the resultback to the client.
By default,
RaftTypeConfig::Responder
retains the existingfunctionality using a oneshot channel, ensuring backward compatibility.
This change is non-breaking, requiring no modifications to existing
applications.
Added: c508a354
Raft::client_write_ff()
ff for fire-and-forget; by 张炎泼; 2024-04-08Raft<C>::client_write_ff() -> C::Responder::Receiver
submit a clientrequest to Raft to update the state machine, returns an application
defined response receiver
Responder::Receiver
to receive the response._ff
means fire and forget.It is same as [
Raft::client_write
] but does not wait for the response.When using this method, it is the application's responsibility for
defining mechanism building and consuming the
Responder::Receiver
.Full Changelog: https://github.com/datafuselabs/openraft/compare/v0.9.4...v0.9.5
v0.9.4
Compare Source
Summary:
declare_raft_types
.TryAsRef<ForwardToLeader<..>>
forRaftError
.Detail:
Changed:
Changed: 2b8bc842 Add default value to
declare_raft_types
;Types used in
declare_raft_types
can be omitted, in which case the default type will be used.The default values for each type are:
D
:String
R
:String
NodeId
:u64
Node
:::openraft::BasicNode
Entry
:::openraft::Entry<Self>
SnapshotData
:Cursor<Vec<u8>>
AsyncRuntime
:::openraft::TokioRuntime
Note that The types must be specified in the exact order:
D
,R
,NodeId
,Node
,Entry
,SnapshotData
,AsyncRuntime
.For example, to declare with only
D
,R
andEntry
types:Type
NodeId
,Node
,SnapshotData
andAsyncRuntime
will be filledwith default values mentioned above.
Or one can just use the default types for all:
Upgrade tip:
Ensures types declared in
declare_raft_types
are in the correct orderAdded:
TryAsRef<ForwardToLeader<..>>
forRaftError
;Full Changelog: https://github.com/datafuselabs/openraft/compare/v0.9.3...v0.9.4
Contributors
v0.9.3
Compare Source
v0.9.2
Compare Source
Raft::config()
returns a ref to Config this raft node uses.RaftMetrics::millis_since_quorum_ack
.Unreachable
error inexamples/raft-kv-rocksdb
.RaftCore
.RaftMetrics
are sent afterRaftDataMetrics
andRaftServerMetrics
.v0.9.1
Compare Source
v0.9.0
Compare Source
Summary:
RaftLogReaderExt::get_log_id()
should not return last-purged-id.get_log_state()
from RaftLogReader to RaftStorage.N, LS, SM
fromRaft<C, N, LS, SM>
.option
argument.ChangeMembers::SetNodes
(#876).--features loosen-follower-log-revert
.PayloadTooLarge
error.Raft::with_raft_state()
to accessRaftState
with a function.openraft::metrics::Wait
.Raft::ensure_linearizable()
to ensure linearizable read.Raft::data_metrics()
andRaft::server_metrics()
(#990).Raft::get_snapshot()
to get the last snapshot from state machine.Raft::install_full_snapshot()
to install a snapshot.Raft::begin_receiving_snapshot()
.RaftNetwork::full_snapshot()
to send a complete snapshot.generic-snapshot-data
.RaftLogStorageExt
to provide additional raft-log methods.snapshot.last_log_id
to metrics until snapshot is finished building/installing.AsyncReadExt::read_buf()
only reads at most 2MB per call.tick_loop()
when the receiver is gone.RaftError
into serialize and deserialize.async_trait
with RPITIT.Detail:
Changed:
Changed: 6098f5cf add AsyncRuntime type parameter to RaftTypeConfig (#869); by wvwwvwwv; 2023-06-21
Add AsyncRuntime type parameter to RaftTypeConfig
This commit introduces the AsyncRuntime type parameter to
RaftTypeConfig, allowing applications to choose their preferred
asynchronous runtime, such as tokio or async-std.
Parameterize Instant type for flexibility with async runtimes
To create a more flexible interface between the crate and
asynchronous runtimes, the Instant type is now associated with the
async runtime. This is because Instant::now can have different
implementations. This commit adds the trait Instant and TokioInstant
for representing system states.
Fix: #741
Changed: 4c488a61 move external command trigger to dedicated Trigger struct (#888); by 张炎泼; 2023-07-01
Refactor: move RaftTypeConfig to separate file
Change: move external command trigger to dedicated Trigger struct
Moved trigger election, heartbeat, snapshot and purge log from
Raft
to a new
Trigger
struct, to separate externally trigger actions fromthe main Raft API.
Marked the old trigger methods in
Raft
as deprecated, and recommendedusing the new
Trigger
struct instead.The main motivation of these changes is to organize the Raft API in a
more structured way, by extracting trigger actions into a dedicated
struct, instead of mixing them together in the
Raft
API.Changed: 5d37d4c3 move runtime config API to dedicated RuntimeConfigHandle; by 张炎泼; 2023-07-02
Changed: 8a81df53
RaftLogReaderExt::get_log_id()
should not return last-purged-id; by 张炎泼; 2023-07-02get_log_id()
should only return present log id,and should not be responsible to return id of an already purged log
entry, which introduce unnecessary complexity.
Upgrade tip:
An RaftStorage implementation should have already maintained the
last-purge-log-id. Avoid getting it via
RaftLogReaderExt::get_log_id()
.Changed: 330b1fff move
get_log_state()
from RaftLogReader to RaftStorage; by 张炎泼; 2023-07-03Move the
get_log_state()
method from theRaftLogReader
trait tothe
RaftStorage
trait.For applications that enable the
storage-v2
feature,get_log_state()
will be moved fromRaftLogReader
toRaftLogStorage
.get_log_state()
should only be called once when openraft starts up.Only the
ReplicationCore
usesRaftLogReader
, and it does not needget_log_state()
. The log entries to replicate are decided byRaftCore
.Upgrade tip:
Implement
get_log_state()
in theRaftStorage
orRaftLogStorage
trait instead of
RaftLogReader
.Refer to the changes in
rocksstore/src/lib.rs
in this commit for anexample.
Changed: 87c0d74f remove
N, LS, SM
fromRaft<C, N, LS, SM>
; by 张炎泼; 2023-11-20Raft<C, ..>
: is a control handle ofRaftCore
and it does not directlyrely on
N: RaftNetworkFactory
,LS: RaftLogStorage
andSM: RaftStateMachine
.Thus these types should not be part of
Raft
.In this commit, we remove
N, LS, SM
fromRaft<C, N, LS, SM>
,RaftInner<C, N, LS>
andRaftMsg<C, N, LS>
.Type
N, LS, SM
now are only used byRaft::new()
which needs thesetypes to create
RaftCore
.Raft::external_request()
: Another change is the signature of theFn
passed toRaft::external_request()
changes fromFnOnce(&RaftState, &mut LS, &mut N)
toFnOnce(&RaftState)
.Fix: the
FnOnce
passed toRaft::external_request()
should alwaysbe
Send
, unoptionally. Because it is used to send fromRaft
toRaftCore
.Fix: #939
Changed: 22cd3bb4 remove deprecated RaftNetwork methods without
option
argument; by 张炎泼; 2024-02-24Changed: a1c7f6e6 remove openraft-0.7 compatibility support; by 张炎泼; 2024-03-04
Added:
Added: d629dbeb add
ChangeMembers::SetNodes
(#876); by 张炎泼; 2023-06-22During dynamic cluster changes, we sometimes need to update an existing
node, for example changing its network address.
Adding
SetNodes
variant toChangeMembers
allows replacing anexisting node directly.
However, this also carries risk of creating a split brain scenario if
used incorrectly.
Added: 104983db add 'singlethreaded' raft mode (#878); by wvwwvwwv; 2023-06-27
The new feature gate forces the raft instance to be used by a single thread by not implementing
Send
for certain data structures and substituting calls totokio::spawn
withtokio::spawn_local
when using thetokio
asynchronous runtime.Re-export
add_async_trait
for application to define a!Send
async trait.Fix: #862
Added: 942ec78b save committed log id; by 张炎泼; 2023-07-16
Wrote committed log id to storage
Save the committed log id to storage before Raft apply log entries. This can
recover state machine to the state corresponding to the committed log id upon
system startup.
Re-applied log entries after startup
If the last applied log id is smaller than the committed log id saved in
storage, re-apply log entries from the next index of last applied log id to the
committed log id.
Version 1 storage API
RaftStorage
and Version 2 storage APIRaftLogStorage
both add APIsave_committed()
andread_committed()
to support saving/reading committed log id.
These two new API are optional and provides default dummy
implementation, an application does not need any modifications if it
does not need this feature.
Added: 6d42c6e2 permit follower log to revert to earlier state with
--features loosen-follower-log-revert
; by 张炎泼; 2023-07-20Add a new feature flag
loosen-follower-log-revert
, to permit thefollower's log to roll back to an earlier state without causing the
leader to panic.
Although log state reversion is typically seen as a bug, enabling it can
be useful for testing or in some special scenarios.
For instance, in an even number nodes cluster, erasing a node's data
and then rebooting it(log reverts to empty) will not result in data
loss.
Added: 3fc8ede6 add feature flag "tracing-log" to emit log record for tracing event; by 张炎泼; 2023-08-02
Added: 961469c0 add
PayloadTooLarge
error; by 张炎泼; 2023-11-24If a
RaftNetwork
implmentation found anAppendEntriesRequest
is toolarge, it could return a
PayloadTooLarge::new_entries_hint(n)
error totell openraft devide request into smaller chunks containing at most
n
entries. Openraft will limit the number of entries in the next 10
AppendEntrie
RPC.Exmaple:
Added: ee3b9421 add
Raft::with_raft_state()
to accessRaftState
with a function; by 张炎泼; 2023-12-06This new method serves as a convenience wrapper around
Raft::external_request()
, streamlining use cases where only a singlevalue needs to be returned.
Thanks to @tvsfx
Added: d1607529 Add new methods to
openraft::metrics::Wait
; by 张炎泼; 2023-12-07Add
log_index()
,log_index_at_least()
,applied_index()
andapplied_index_at_least()
toopenraft::metrics::Wait
to replaceWait::log()
andWait::log_at_least()
.These two methods are deprecated since
0.9.0
because the names doesnot imply that they will be blocked by
last_applied
log index.Thanks to @tvsfx
Added: 79372b4d add
Raft::ensure_linearizable()
to ensure linearizable read; by 张炎泼; 2023-12-07The
Raft::is_leader()
method does not fully ensure linearizable readoperations and is deprecated in this version. Instead, applications
should use the
Raft::ensure_linearizable()
method to guaranteelinearizability.
Under the hood,
Raft::ensure_linearizable()
obtains aReadIndex
fromRaftCore
if it remains the leader, and blocks until the statemachine applies up to the
ReadIndex
. This process ensures that theapplication observes all state visible to a preceding read operation.
Upgrade tip:
Replace
Raft::is_leader()
withRaft::ensure_linearizable()
.Added: 82615896 add
Raft::data_metrics()
andRaft::server_metrics()
(#990); by YangKian; 2024-01-14Added: c1cf8a82 add
Raft::get_snapshot()
to get the last snapshot from state machine; by 张炎泼; 2024-02-10Added: c1aa1b5a add
Raft::install_full_snapshot()
to install a snapshot; by 张炎泼; 2024-02-10Using this method, the application provides a full snapshot to
Openraft, which is then used to install and replace the state machine.
It is entirely the responsibility of the application to acquire a
snapshot through any means: be it in chunks, as a stream, or via shared
storage solutions like S3.
This method necessitates that the caller supplies a valid
Vote
toconfirm the legitimacy of the leader, mirroring the requirements of
other Raft protocol APIs such as
append_entries
andvote
.Added: 5631ecfb Add
Raft::begin_receiving_snapshot()
; by 张炎泼; 2024-02-14Raft::begin_receiving_snapshot()
request the state machine to return aSnapshotData
for receiving snapshot from the leader.Internally it calls
RaftStateMachine::begin_receiving_snapshot()
Handling snapshot receiving is moved out of state-machine worker task.
Now it is in implemented outside the
RaftCore
.Receiving snapshot could be totally application specific and should not
be part of Openraft.
The in sm-worker snapshot receiving is removed.
Added: 687fcf2f
RaftNetwork::full_snapshot()
to send a complete snapshot; by 张炎泼; 2024-02-11Add
RaftNetwork::snapshot()
to send a complete snapshot and movesending snapshot by chunks out of ReplicationCore.
To enable a fully customizable implementation of snapshot transmission
tailored to the application's needs, this commit relocates the
chunk-by-chunk transmission logic from
ReplicationCore
to a newsub mod,
crate::network::snapshot_transport
.The
snapshot_transport
mod provides a default chunk-based snapshottransmission mechanism, which can be overridden by creating a custom
implementation of the
RaftNetwork::full_snapshot()
method. As part of thiscommit,
RaftNetwork::full_snapshot()
simply delegates tosnapshot_transport
.Developers may use
snapshot_transport
as a reference when implementingtheir own snapshot transmission strategy.
Snapshot transmission is internally divided into two distinct phases:
Upon request for snapshot transmission,
ReplicationCore
initiates anew task
RaftNetwork::full_snapshot()
dedicated to sending a completeSnapshot
. This task should be able to be terminated gracefully bysubscribing the
cancel
future.Once the snapshot has been fully transmitted by
RaftNetwork::full_snapshot()
, the task signals an event back toReplicationCore
. Subsequently,ReplicationCore
informsRaftCore
of the event, allowing it to acknowledge the completion of the
snapshot transmission.
Other changes:
ReplicationCore
has twoRaftNetwork
s, one for log replication andheartbeat, the other for snapshot only.
ReplicationClosed
becomes a public error for notifying theapplication implemented sender that a snapshot replication is
canceled.
StreamingError
is introduced as a container of errors that may occurin application defined snapshot transmission, including local IO
error, network errors, errors returned by remote peer and
ReplicationClosed
.The
SnapshotResponse
type is introduced to differentiate it from theInstallSnapshotResponse
, which is used for chunk-based responses.Added: 907f5f74 feature flag
generic-snapshot-data
; by 张炎泼; 2024-02-16Add feature flag
generic-snapshot-data
: when enabled,SnapshotData
does not have
AsyncSeek + AsyncRead + AsyncWrite
bound.This enables application to define their own snapshot format and
transmission protocol.
If this feature flag is not eabled, no changes are required for
application to upgrade Openraft.
On the sending end(leader that sends snapshot to follower):
Without
generic-snapshot-data
:RaftNetwork::snapshot()
provides a default implementation that invokes the chunk based API
RaftNetwork::install_snapshot()
for transmit.With
generic-snapshot-data
enabled:RaftNetwork::snapshot()
must beimplemented to provide application customized snapshot transmission.
Application does not need to implement
RaftNetwork::install_snapshot()
.On the receiving end(follower):
Raft::install_snapshot()
is available only whengeneric-snapshot-data
is disabled.Add an example
examples/raft-kv-memstore-generic-snapshot-data
withgeneric-snapshot-data
enabled.In this example snapshot is transmitted without fragmentation, i.e., via
RaftNetwork::snapshot()
. The chunk based APIRaftNetwork::install_snapshot()
is not used.In a production scenario, a snapshot can be transmitted in arbitrary
manner.
Added: 884f0da6 add trait
RaftLogStorageExt
to provide additional raft-log methods; by 张炎泼; 2024-03-04The
RaftLogReaderExt::blocking_append()
method enables the caller toappend logs to storage in a blocking manner, eliminating the need to
create and await a callback. This method simplifies the process of
writing tests.
Fixed:
Fixed: 86b46a08 restore replication progress when a leader starts up (#884); by 张炎泼; 2023-06-29
As a leader, the replication progress to itself should be restored upon
startup.
And if this leader is the only node in a cluster, it should re-apply all
of the logs to state machine at once.
Fixed: 97254a31 Do not report
snapshot.last_log_id
to metrics until snapshot is finished building/installing; by 张炎泼; 2023-10-18Before this commit
RaftMetrics.snapshot
contains the last log id of asnapshot that is going to install. Therefore there is chance the
metrics is updated but the store does not.
In this commit,
RaftMetrics.snapshot
will only be updated when asnapshot is finished building or installing, by adding a new field
snpashot
toIOState
for tracking persisted snapshot meta data.Fixed: ffae5224
AsyncReadExt::read_buf()
only reads at most 2MB per call; by 张炎泼; 2023-11-08When streaming a snapshot chunk, it should repeatly
read_buf()
untilsnapshot_max_chunk_size
is full or read EOF.Fixed: f41729a1 End
tick_loop()
when the receiver is gone.; by Ivan Schréter; 2023-11-13Currently,
tick_loop()
would keep printing the trace message everytick even when the receiver (Raft main loop) is gone in this form:
INFO openraft::core::tick: .../tick.rs:70: Tick fails to send, receiving end quit: channel closed
If the tick message fails to send, then terminate the loop, since every
future message will fail to send as well.
Also adjust the trace message to better describe what happened.
Fixed: 0799972e Split serde bound for
RaftError
into serialize and deserialize; by Thomas Van Strydonck; 2024-01-16Improved:
async_trait
with RPITIT; by Josh Griffith; 2024-01-28v0.8.9
Compare Source
What's Changed
Clone
from traitAppData
by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/740RaftStorage::append_to_log()
now accepts anIntoIterator
by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/742RaftStateMachine
out ofRaftStorage
by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/763RaftMetrics.replication
type toBTreeMap<NodeId, Option<LogId>>
by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/785notify
specifically for interal messages by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/794RaftTypeConfig
by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/799RaftMetrics.vote
,Wait::vote()
by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/815RaftNetwork::send_append_entries()
can return PartialSuccess by @drmingdrmer in https://github.com/datafuselabs/openraft/pull/831New Contributors
Full Changelog: https://github.com/datafuselabs/openraft/compare/v0.8.3...v0.8.9
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
498b7157d5
to35acb1c818
35acb1c818
to5c9ec4f34f
5c9ec4f34f
to3c4f1116a9
3c4f1116a9
to8f515cd882
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.