|
| 1 | +## v0.8.2 |
| 2 | + |
| 3 | +### Changed: |
| 4 | + |
| 5 | +- Changed: [342d0de2](https://github.com/datafuselabs/openraft/commit/342d0de2b885388dfa5de64430384bd3275d3697) rename variants in ChangeMembers, add `AddVoters`; by 张炎泼; 2023-03-01 |
| 6 | + |
| 7 | + Rename `ChangeMembers::AddVoter` to `AddVoterIds`, because it just |
| 8 | + updates voter ids. |
| 9 | + |
| 10 | + Rename `ChangeMembers::RemoveVoter` to `RemoveVoters`. |
| 11 | + |
| 12 | + Add `ChangeMembers::AddVoters(BTreeMap)` to add voters with |
| 13 | + corresponding `Node`, i.e., it adds nodes as learners and update |
| 14 | + the voter-ids in a `Membership`. |
| 15 | + |
| 16 | +### Added: |
| 17 | + |
| 18 | +- Added: [50821c37](https://github.com/datafuselabs/openraft/commit/50821c37035850dba9e237d9e7474e918f2bd410) impl PartialEq for Entry; by 张炎泼; 2023-03-02 |
| 19 | + |
| 20 | +### Fixed: |
| 21 | + |
| 22 | +- Fixed: [97fa1581](https://github.com/datafuselabs/openraft/commit/97fa15815a7d51c35a3a613b11defbf5f49cf4c1) discard blank log heartbeat, revert to the standard heartbeat; by 张炎泼; 2023-03-04 |
| 23 | + |
| 24 | + - https://github.com/datafuselabs/openraft/issues/698 |
| 25 | + |
| 26 | + The blank log heartbeat design has two problems: |
| 27 | + |
| 28 | + - The heartbeat that sends a blank log introduces additional I/O, as a follower has to persist every log to maintain correctness. |
| 29 | + |
| 30 | + - Although `(term, log_index)` serves as a pseudo time in Raft, measuring whether a node has caught up with the leader and is capable of becoming a new leader, leadership is not solely determined by this pseudo time. |
| 31 | + Wall clock time is also taken into account. |
| 32 | + |
| 33 | + There may be a case where the pseudo time is not upto date but the clock time is, and the node should not become the leader. |
| 34 | + For example, in a cluster of three nodes, if the leader (node-1) is busy sending a snapshot to node-2(it has not yet replicated the latest logs to a quorum, but node-2 received message from the leader(node-1), thus it knew there is an active leader), node-3 should not seize leadership from node-1. |
| 35 | + This is why there needs to be two types of time, pseudo time `(term, log_index)` and wall clock time, to protect leadership. |
| 36 | + |
| 37 | + In the follow graph: |
| 38 | + - node-1 is the leader, has 4 log entries, and is sending a snapshot to |
| 39 | + node-2, |
| 40 | + - node-2 received several chunks of snapshot, and it perceived an active |
| 41 | + leader thus extended leader lease. |
| 42 | + - node-3 tried to send vote request to node-2, although node-2 do not have |
| 43 | + as many logs as node-3, it should still reject node-3's vote request |
| 44 | + because the leader lease has not yet expired. |
| 45 | + |
| 46 | + In the obsolete design, extending pseudo time `(term, index)` with a |
| 47 | + `tick`, in this case node-3 will seize the leadership from node-2. |
| 48 | + |
| 49 | + ```text |
| 50 | + Ni: Node i |
| 51 | + Ei: log entry i |
| 52 | +
|
| 53 | + N1 E1 E2 E3 E4 |
| 54 | + | |
| 55 | + v |
| 56 | + N2 snapshot |
| 57 | + +-----------------+ |
| 58 | + ^ | |
| 59 | + | leader lease |
| 60 | + | |
| 61 | + N3 E1 E2 E3 | vote-request |
| 62 | + ---------------+----------------------------> clock time |
| 63 | + now |
| 64 | +
|
| 65 | + ``` |
| 66 | +
|
| 67 | + The original document is presented below for reference. |
| 68 | +
|
| 69 | +- Fixed: [b5caa44d](https://github.com/datafuselabs/openraft/commit/b5caa44d1aac0b539180c1c490f0883dcc83048a) Wait::members() should not count learners as members; by 张炎泼; 2023-03-04 |
| 70 | +
|
| 71 | + `Wait::members()` waits until membership becomes the expected value. |
| 72 | + It should not check against all nodes. |
| 73 | + Instead, it should only check voters, excluding learners. |
| 74 | +
|
1 | 75 | ## v0.8.1
|
2 | 76 |
|
3 | 77 | ### Added:
|
|
0 commit comments