Skip to content

Releases: databendlabs/openraft

v0.9.17

15 Oct 05:06
Compare
Choose a tag to compare

Summary:

  • Improved:
    • 536a435e Chunk read log entry and check range on startup.
    • dc18dc6f remove Copy bound from NodeId.

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 from NodeId; by 张炎泼; 2024-10-14

    The NodeId type is currently defined as:

    type NodeId: .. + Copy + .. + 'static;

    This commit removes the Copy bound from NodeId.
    This modification will allow the use of non-Copy types as NodeId,
    providing greater flexibility for applications that prefer
    variable-length strings or other non-Copy types for node
    identification.

    This change maintain compatibility by updating derived Copy
    implementations with manual implementations:

    // Before
    #[derive(Copy...)]
    pub struct LogId<NID: NodeId> {}
    
    // After
    impl<NID: Copy> Copy for LogId<NID> {}

v0.9.16

05 Sep 16:27
Compare
Choose a tag to compare

What's Changed

  • Fix: Prevent panic when calling Raft::change_membership() on uninitialized node by @drmingdrmer in #1243

Full Changelog: v0.9.15...v0.9.16

v0.9.15

28 Aug 05:15
Compare
Choose a tag to compare

Summary:

  • Fixed:
    • 0b1293f3 Should not update vote when seeing higher vote in RequestVote response.
    • 94b1e843 Clarify that receiving an equal vote does not grant leadership.
  • Added:
    • 5f5d7e9f Add TypeConfigExt to simplify RaftTypeConfig Access.

Detail:

Fixed:

  • Fixed: 0b1293f3 Should not update vote when seeing higher vote in RequestVote response; by 张炎泼; 2024-07-04

    This commit addresses an issue in the vote updating mechanism during the
    handling of RequestVote responses. Previously, encountering a higher
    vote in a response incorrectly led to an update of the local
    state.vote, which could break Raft consistency rules.

    Issue Description:

    • A higher vote seen in a RequestVote response does not necessarily
      mean that the vote is granted. The local state.vote should only be
      updated if the vote is actually granted, i.e., the responding node has
      a higher vote and a last_log_id that allows it to become a leader.

    Resolution:

    • The local state.vote will no longer be updated upon merely seeing a
      higher vote in the RequestVote response. Instead, this higher vote
      will be recorded in last_seen_vote for consideration in the next
      election 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 vote
    is granted.

    This commit also fix:

Added:

  • Added: 5f5d7e9f Add TypeConfigExt to simplify RaftTypeConfig Access; by 张炎泼; 2024-07-03

    This commit introduces a new trait, TypeConfigExt, which extends
    RaftTypeConfig. The purpose of this trait is to simplify the access to
    various 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:

    • Instead of using the
      <<C as RaftTypeConfig>::AsyncRuntime as AsyncRuntime>::Instant::now(),
      you can now simply call C::now().

v0.9.13

21 Jun 08:00
Compare
Choose a tag to compare

Summary:

  • Added:
    • fb49efb3 Add DecomposeResult to simplify error handling.

Detail:

Added:

  • Added: fb49efb3 Add DecomposeResult to simplify error handling; by 张炎泼; 2024-06-20

    This commit treats remote errors occurring during RPC, like a Fatal
    error, as an Unreachable error. This is due to Openraft's current
    inability to distinguish between an unreachable node and a broken node.

    • Helper trait DecomposeResult: Introduced to simplify handling
      composite errors. It converts a result of the
      form Result<R, ErrorAOrB>
      into a nested result Result<Result<R, ErrorA>, ErrorB>.

v0.9.12

16 Jun 06:07
Compare
Choose a tag to compare

Summary:

  • DocFixed:
    • 1385394c RemoveNodes -> add_leaner in dynamic-membership.
  • Added:
    • 8cd00388 Add RaftLogReader::limited_get_log_entries().

Detail:

DocFixed:

  • DocFixed: 1385394c RemoveNodes -> add_leaner in dynamic-membership; by shuo; 2024-06-08

Added:

  • Added: 8cd00388 Add RaftLogReader::limited_get_log_entries(); by 张炎泼; 2024-06-16

    This 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

20 May 06:35
Compare
Choose a tag to compare

Summary:

  • Fixed:
    • 30cdf5fb New leader must flush blank log.

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) may
    not be visible.

    This issue is addressed by utilizing LeaderHandler::leader_append_entries()
    instead of ReplicationHandler::append_blank_log(), where the former
    does 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 from
      RaftState to Leading.

    • Avoid manual implementation of duplicated logic:

      • During initialize(), reuse FollowingHandler::do_append_entries()
        to submit the very first log to storage.

      • In establish_leader(), reuse
        LeaderHandler::leader_append_entries() to submit log to storage
        and remove ReplicationHandler::append_blank_log().

      • Remove Command::AppendEntry.

v0.9.10

07 May 13:41
Compare
Choose a tag to compare

Summary:

  • Improved:
    • 14f174e9 cancel passed to full_snapshot() should be static.

Detail:

Improved:

  • Improved: 14f174e9 cancel passed to full_snapshot() should be static; by 张炎泼; 2024-05-06

v0.9.9

05 May 08:41
Compare
Choose a tag to compare

Summary:

  • Fixed:
    • 8b62c797 Immediate response when snapshot installation is unnecessary.

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 provided
    snapshot 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 the
    caller is informed straightaway that no installation will occur.

v0.9.8

03 May 04:33
Compare
Choose a tag to compare

Summary:

  • Fixed:
    • fd5c657f Chunked should reset offset 0 when a SnapshotMismatch error is received.

Detail:

Fixed:

  • Fixed: fd5c657f Chunked should reset offset 0 when a SnapshotMismatch error is received; by 张炎泼; 2024-05-02

    When a SnapshotMismatch is received, the sending end should re-send
    all snapshot data from the beginning.

v0.9.7

25 Apr 13:32
Compare
Choose a tag to compare

Summary:

  • Fixed:
    • ff4cf8fe openraft-0.9.6 requires openraft-macros-0.9.6 or newer.

Detail:

Fixed:

  • Fixed: ff4cf8fe openraft-0.9.6 requires openraft-macros-0.9.6 or newer; by 张炎泼; 2024-04-25