Skip to content

v0.10.0

Latest

Choose a tag to compare

@drmingdrmer drmingdrmer released this 10 Nov 13:36
· 47 commits to main since this release

Openraft 0.10 makes most of its types pluggable, moves optional parts into separate crates, and adds configurable quorum rules, pipelined replication, Pre-Vote, leadership transfer and faster linearizable reads. It also fixes several safety bugs. It uses the Rust 2024 edition and needs Rust 1.88 or later.

Upgrade from 0.9

Upgrading requires code changes. The upgrade guide covers each breaking change.

With the default types, stored data needs no migration: log entries, membership, vote and snapshot metadata keep their 0.9 serialized form, and a Config that 0.9 serialized still decodes. Data and wire compatibility describes what 0.9 and 0.10 peers can exchange.

release-0.9 keeps receiving bug fixes until 0.11 development starts.

Major changes

  • New crates. The async runtime abstraction moved to openraft-rt, with runtimes in openraft-rt-tokio, openraft-rt-compio, openraft-rt-monoio and openraft-rt-sim. The v1 network API moved to openraft-legacy. openraft-membership provides other quorum rules, openraft-multi shares connections across Raft groups, and openraft-metrics-otel exports OpenTelemetry metrics. openraft-rocksstore and openraft-sledstore are no longer released.
  • Configurable types. RaftTypeConfig selects the term, leader id, vote, payload, membership, error source, batch container and client-write responder.
  • Membership. A membership type defines separate read and write quorums and per-node roles; openraft-membership provides threshold, weighted, grid, hierarchical and explicit memberships. change_membership() writes one log entry when the old and new quorums intersect.
  • Replication. The leader pipelines AppendEntries through RaftNetworkV2::stream_append(). Followers report conflict hints that shorten the log-matching search, and consecutive appends merge into one storage write.
  • Elections and leadership. Optional Pre-Vote stops partitioned nodes from inflating the term, and Trigger::transfer_leader() hands leadership to a chosen node.
  • Linearizable reads. Each read chooses its policy with LinearizerOption. One heartbeat round answers every waiting read, and get_local_read_linearizer() serves lease reads without a RaftCore round trip.
  • Safety fixes. A restarted leader wins a new election before it accepts proposals, instead of reusing log ids for different entries (#2167). A leader commits a blank entry of its own term before it changes membership, so two leaders cannot commit disjoint configs. A restarted follower keeps its vote lease, so a lease read on the old leader cannot miss a committed write. Startup rejects a store whose state machine misses purged logs (#2222).

More details