- 03 Mar, 2019 4 commits
-
-
Jay Guo authored
This CR changes Errored to return a channel that is closed when node becomes candidate. Change-Id: Ibd0ece763b9d93c4da93825d1b302ecc55a9b32e Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
Store raft SoftState in raft chain so it returns error while election is ongoing. This prevents a disconnected follower from returning success on Broadcast API. Change-Id: Ib6619b230938f0d6c10240b8cd8e34e346056145 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
This CR changes type of etcdraft observe channel from uint64 to raft.SoftState, so that chain_test can assert not only leader id, but also the state of node. Change-Id: Ia0c5f8c9060c234ceb84133e0c5598ed064dd1ee Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
Add a lock to guard manipulation of `StepStub`. Change-Id: Icaadb1f5aea0cb7f266f24ed6756c4f6541768bd Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
- 27 Feb, 2019 15 commits
-
-
Artem Barger authored
Currently there is a single instance of ledger shared between instance of chain mock in unit-tests. This commit introduces ledger instance per chain. Change-Id: I333fa2819490c995931a7e0d241eb6428e67c87e Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
Artem Barger authored
Change-Id: Ib77c866a30ed5108ad53908b0ca25a60a89e9a7c Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
Jay Guo authored
This CR rewrites BlockCreator so that it doesn't return nil block. BEFORE: blockcreator holds a channel of created blocks, which is buffered with size of createdBlocksBuffersize (default 20). It also stores the hash and number of latest block. When requested to create new block, blockcreator does so by assembling a block based on that hash and number, enque the block to buffered channel. If channel is full, a nil is returned. When commit a block, it drains the channel. If there's nothing in the channel, it implies the blockcreator is manipulated by raft follower, therefore blockreator simply updates hash and number. NOW: what we need is actually as simple as: a blockcreator holds the hash and number of latest block. When it is requested to create a block, it just uses that hash and number to assemble one. And ONLY raft leader holds a blockcreator. Followers blindly commit whatever comes from consensus. When a follower is elected as new leader, it simply looks up the ledger, find hash and number of latest block, and creates a new blockcreator. Change-Id: I226ee34d666fbb1e8d034dc22ea6800df993f7a4 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
Change-Id: I9fe663c4efa46e5644571d238f4d7ea8f4e51626 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
When joining a fresh node to existing etcdraft cluster, it should be using empty peer list to call `StartNode`. Change-Id: Ib6acf6fd9b2956680c99d5d7370ce439228d3bfa Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
When new leader performs failover check and finds out leftover ConfChange, it should re-propose that AND do not accept new env until ConfChange is applied. This CR also moves type b config failover check from `serveRaft` to `serveRequest` go routine. `serveRaft` now only takes care of raft related logics, therefore making the code easier to reason about. Change-Id: I4e32cb155abff52e7d1c0fbe4c6f2aa5e5ef1605 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
Change-Id: I85cb5b5cc633f27fa4f317bd2b0f6d947fd97a6d Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
Change-Id: Icd364101a350ab6fa2959f196f346c717a16337f Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
This CR removes a redundant assertion in etcdraft UT to avoid flakiness. The assertion being removed checks that expected number of MsgApp are dropped since node is disconnected from network. However, when a raft candidate is elected as leader, it broadcasts MsgApp containing empty data to followers, and sometimes this is being counted as part of dropped MsgApp, which causes unmatched expectation. We could be more precise by inspecting MsgApp on wire, and neglect empty messages, so we still perform this assertion. But it is anyway a redundant check, therefore can be safely removed. This CR also further reduces total test time. Change-Id: I74af9fecfebe20e44c6736a644352f8b67b624e3 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
In raft, to commit a message, leader firstly broadcasts MsgApp to replicate data, and once it receives MsgAppResp from quorum, it - applies message to state machine - broadcasts another MsgApp to instruct followers to commit and these are done in parallel. To emulate situation where a node is disconnected *after* config block is committed and *before* node add/remove in that config block is proposed to raft, `WriteConfigBlock` stub on leader was overloaded to disconnect node from the network, so that ConfChange is proposed but dropped. However this becomes racy when we want to assert the config block is committed on followers as well, since we might disconnect leader too fast, and cause the second round of MsgApp to be dropped, so that config block is not committed on followers. This is fine in real case because new leader will continue the effort to commit this block. To circumvent this flakiness, this CR changes UT to overload `StepStub` instead of `WriteConfigBlockStub`, so that we can be more precise on when to disconnect a node from network. Change-Id: Ic1b7d28c043e779c7cc258c2e08bfaa3578bc429 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
This CR adds an UT to attest retransmission of etcd/raft MsgApp. Change-Id: Ic06003ae7da9dc1dcc991103e6748b55a47f04dc Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
The UT being fixed in this CR submits a malformed config env, which crashes test. It passed because we never wait for the block to be committed and shut down test early. Change-Id: I40311ccbf03d8ffb73d4467e5695a28b4834d61e Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
Change-Id: I64c232fe6433b9f6ca0dadbabfcc771f3f2c623f Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
Change-Id: Idc65a77259ae7a153aa4d077f9e72d1e2961ab46 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Artem Barger authored
This commits handles the case where config transaction of type B is submitted and Raft cluster quorum fails/shutdowns. During startup, leader compares last known configuration with Raft config state and if there is a difference, finalize reconfiguration by proposing delta. Change-Id: I3cdf03533602489cb56c503f1d6651f27a5fc6a1 Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
- 05 Dec, 2018 1 commit
-
-
Kostas Christidis authored
Change-Id: Ie918792893f3353652cc49f27622d02dd871e689 Signed-off-by:
Kostas Christidis <kostas@christidis.io>
-
- 30 Nov, 2018 2 commits
-
-
Adarsh Saraf authored
This CR enables optimistic creation of a chain of blocks in etcd/raft to pipeline block creation and consensus on the created blocks. We cannot do the pipelining for config blocks since all messages need to be revalidated upon a config change. Change-Id: Iabf1d4c75584afe8f641a18153d5e1b4b94f6bcc Signed-off-by:
Adarsh Saraf <adarshsaraf123@gmail.com>
-
Artem Barger authored
Raft cluster reconfigiration consists of two parts, first leader has to consent on configuration block, next leader has to extract new cluster configuration and propose raft configuration changes. However leader might fail between first and second parts, therefore newly selected leader should be able to detect there is unfinished reconfiguration and to finish reconfiguration. This commit adds logic to manage leadership failover, where new leader checks whenever last committed block is configuration block, whenever there are pending configuration changes and complete reconfiguration by proposing raft clust configuration changes. Change-Id: I05dc1f60c9ab692521887b50f726d96ea47878dc Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
- 19 Nov, 2018 5 commits
-
-
Jay Guo authored
This option prevents a reconnected node from disturbing network. Change-Id: Ie7073cc2e84c3945d7b708fae9e52b999ba793d2 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
This commit adds support for Raft cluster reconfiguration, takes care to extract cluster config changes from the config block and apply those changes to the replic set. Change-Id: I564fafa418757e565ec2c0d872174d5d4f1ad719 Signed-off-by:
Artem Barger <bartem@il.ibm.com> Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Artem Barger authored
FAB-12730 #done Change-Id: Ief7b85827ba950a27d4b4240a5b276072e524b40 Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
Artem Barger authored
Refactors Raft ordering service UT to support reconfiguration, i.e. addition/removal of new nodes, introducing capability to inject new chains into mocked network. Change-Id: Ieb7f8973002ce2c70a59c7985aa09fc9fd0839ed Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
Jay Guo authored
This CR adds enables etcd/raft based chain to take snapshot for every `SnapInterval` blocks. It stores snapshot to wal and disk. When node restarts, it loads latest snapshot and uses Term and Index stored in it to replay WAL to memory storage. Change-Id: Ib8c22173cd5b05b7a1b27b16e2003bdabbecf82a Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
- 08 Nov, 2018 2 commits
-
-
Jay Guo authored
This CR refactors storage etcd/raft chain implementation to bundle memory storage and wal together. Change-Id: Ib0dc95497dc9a0747c365ef78d0a702382445f55 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Jay Guo authored
This CR adds WAL to etcdraft to persist log entries, so that an etcdraft based chain can continue from where it's left. The index of log entry is persisted with block as its metadata so written blocks are not replayed. Change-Id: I7e4131541d90b256d767a9421ab6ae2a47a88bcd Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
- 29 Oct, 2018 2 commits
-
-
Jay Guo authored
Change-Id: I40739764d34fc9d08ed14fb8fb046a80cb0f29e0 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-
Artem Barger authored
This commit adds new message to hold information about mapping from consenters to theirs ids and to keep track on the next id to be assigned for new coming replica. Moreover update write block path to actually persist information about raft cluster membership mapping. Change-Id: I638b30fc5729a0d02f21a40989deb93e42b09836 Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
- 18 Oct, 2018 1 commit
-
-
Artem Barger authored
This commit allows Raft transactions updates which changes algorithm parameters, while no update or change of consenters set is supported yet. Change-Id: Iefefa130302c78a8e00de005ff3421d2a686eb38 Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
- 17 Oct, 2018 1 commit
-
-
Matthew Sykes authored
Let the tool do what it wants with the imports. Change-Id: I115230369be6349d89b5869951ce088ce38d8fb6 Signed-off-by:
Matthew Sykes <sykesmat@us.ibm.com>
-
- 16 Oct, 2018 1 commit
-
-
Jay Guo authored
This CR makes etcdraft.Chain consume communication layer to pass messages among Raft nodes, so that they are able to form a cluster. Change-Id: I60327f1c1c6942db037e55f17da4d6d5b632ee2a Signed-off-by:
Jay Guo <guojiannan1101@gmail.com> Signed-off-by:
yacovm <yacovm@il.ibm.com> Signed-off-by:
Kostas Christidis <kostas@christidis.io>
-
- 14 Oct, 2018 1 commit
-
-
Artem Barger authored
This commit enables creation of Raft based channel and aligns unit-tests accordingly. Change-Id: Iead5cddcab5137b0bce9740f47db8a3f583f2f4f Signed-off-by:
Artem Barger <bartem@il.ibm.com>
-
- 08 Oct, 2018 2 commits
-
-
Adarsh Saraf authored
This CR Allows Type A config updates while rejecting the type B ones for the etcd/raft consenter. For definition of Type A and Type B config updates please refer to the JIRA. Change-Id: If7351eb28fe66ff7ca31e45206ed044ee2937051 Signed-off-by:
Adarsh Saraf <adarshsaraf123@gmail.com>
-
yacovm authored
This change set: 1) Wires the consenter into the registrar 2) Wires the communication to the consenter and to the registrar, in preperation for multi-node Raft. This makes a new chain configure the communication layer of the cluster according to the TLS certificates of the channel. 3) Adds a unit test that spawns a Raft OSN Change-Id: I3923f6f5e0fae6428c2be2e056b82355332f3324 Signed-off-by:
yacovm <yacovm@il.ibm.com>
-
- 28 Sep, 2018 2 commits
-
-
Matthew Sykes authored
Ticks are not guaranteed to be delivered in the event of slow receivers: <quote ref="https://godoc.org/time#NewTicker "> It adjusts the intervals or drops ticks to make up for slow receivers. </quote> Also remove unnecessary casts of numeric constants. Change-Id: I7c85cf2435bd044231e542de106098e0eadd5312 Signed-off-by:
Matthew Sykes <sykesmat@us.ibm.com>
-
Matthew Sykes authored
The mock block cutter has no serialization but needs it. Change-Id: I538789c4152279b6da1f73e5059525b7bbe25335 Signed-off-by:
Matthew Sykes <sykesmat@us.ibm.com>
-
- 17 Sep, 2018 1 commit
-
-
Jay Guo authored
This CR also adds tests for etcdraft chain. Change-Id: I8f86a117a9b1642df2745ef7e48e8bddf8f898e3 Signed-off-by:
Jay Guo <guojiannan1101@gmail.com>
-