1. 03 Mar, 2019 7 commits
  2. 27 Feb, 2019 12 commits
    • Jay Guo's avatar
      [FAB-13447] Streamline the code · d735a06c
      Jay Guo authored
      Instead of returning status several levels up, several methods
      in etcdraft chain can just set member var to store current state.
      Change-Id: I67612917bf3bb3225f1507c8b7376d730b18e9f4
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
    • Artem Barger's avatar
      [FAB-12945] add raft reconfiguration unit-tests · 07b7309c
      Artem Barger authored
      Change-Id: Ib77c866a30ed5108ad53908b0ca25a60a89e9a7c
      Signed-off-by: default avatarArtem Barger <bartem@il.ibm.com>
    • Jay Guo's avatar
      [FAB-13178] A dumb version of etcdraft BlockCreator · ff843afd
      Jay Guo authored
      This CR rewrites BlockCreator so that it doesn't return nil block.
      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.
      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: default avatarJay Guo <guojiannan1101@gmail.com>
    • Jay Guo's avatar
      [FAB-13178] Remove global leader var in etcdraft chain · f28884a4
      Jay Guo authored
      This CR removes the global leader var in etcdraft chain because
      it is racy in following case: several requests are to be enqued
      into submitC while leader loses its leadership.
      This also removes the lock on rpc.SendSubmit because it's guarded
      by the channel.
      Change-Id: If5e785e05dcf9bfc60e403f2d5813baf769ee103
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
    • Jay Guo's avatar
      [FAB-13178] Move raft logic to its own file · ae55c51e
      Jay Guo authored
      This CR makes raft-facing logic more contained by encapsulating
      them in a seperate object, in a new file. This CR also simplify
      the implementation by removing some unecessary locking and channels
      Change-Id: Ibefe74a35f0645955cbb3885efc8a3f8aaa0a8ca
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
    • Jay Guo's avatar
      [FAB-13456] Use empty peer list to join raft cluster · 2755580a
      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: default avatarJay Guo <guojiannan1101@gmail.com>
    • Jay Guo's avatar
      [FAB-13178] do not accept new env when conf in flight · 06ce7476
      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: default avatarJay Guo <guojiannan1101@gmail.com>
    • Jay Guo's avatar
      [FAB-13178] Refactor etcdraft chain to avoid sync · b110a626
      Jay Guo authored
      This CR moves the logics that applies raft data to state machine
      from `serveRaft` to `serveRequest` go routine to avoid some
      coordinations between them.
      Change-Id: I7331976d0f0c256c853f09e15ca8682dd9a0322d
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
    • Jay Guo's avatar
      [FAB-13178] Simplify the proposition of config block · fb6ffe8f
      Jay Guo authored
      Change-Id: Ie755722f7db1df5efca5dea43d9912fdf36b6d25
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
    • Artem Barger's avatar
      [FAB-13225] address code review comments · 52296172
      Artem Barger authored
      This commit address code review comments left from review of CR related
      to FAB-12552.
      Change-Id: I04635d36d7076cf89d43f42aa5351692b8d1782e
      Signed-off-by: default avatarArtem Barger <bartem@il.ibm.com>
    • Jay Guo's avatar
      [FAB-13057] Remove applied index check in storage · 58cc633f
      Jay Guo authored
      For etcdraft chain, if there is applied index (>0) in
      block metadata, then the node is expected not to be fresh
      and should have wal data.
      This CR removes this constraints because that's not the
      case anymore with onboarding, since one node may pull blocks
      from other nodes before bootstrap chain.
      Change-Id: I678db4d1d71a24e08685d9c73eee7f4bc281771f
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
    • Artem Barger's avatar
      [FAB-12949] finish reconfiguration after restart · eb5aef1d
      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: default avatarArtem Barger <bartem@il.ibm.com>
  3. 01 Dec, 2018 1 commit
    • Jay Guo's avatar
      [FAB-12919] Serialize `SendSubmit` invocation. · 50af08bd
      Jay Guo authored
      This CR adds a mutex to guard parallel access to `SendSubmit`
      rpc call in etcdraft chain, due to thread-unsafe of gRPC.
      This is going to be tested by subsequent benchmark tests.
      Without this serialization, loading etcdraft orderer with
      many parallel requests would most likely cause a dead-lock
      in communication, which causes benchmark test to stuck.
      Change-Id: Id2f6e8f86f7465880725e1aecc7374c3e9e4106e
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
  4. 30 Nov, 2018 2 commits
    • Adarsh Saraf's avatar
      [FAB-12354] Optimistic chain creation in etcd/raft · c0f21330
      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: default avatarAdarsh Saraf <adarshsaraf123@gmail.com>
    • Artem Barger's avatar
      [FAB-12576] failover while handling tx type B · f98f7c4e
      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: default avatarArtem Barger <bartem@il.ibm.com>
  5. 19 Nov, 2018 3 commits
  6. 12 Nov, 2018 1 commit
  7. 08 Nov, 2018 2 commits
  8. 29 Oct, 2018 1 commit
    • Artem Barger's avatar
      [FAB-12477]: add etcd/raft membership message · fc0c4e91
      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: default avatarArtem Barger <bartem@il.ibm.com>
  9. 18 Oct, 2018 1 commit
  10. 16 Oct, 2018 1 commit
  11. 14 Oct, 2018 1 commit
  12. 08 Oct, 2018 2 commits
    • Adarsh Saraf's avatar
      [FAB-11897] Enable Type A etcd/raft config updates · 635cd8c9
      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
      Change-Id: If7351eb28fe66ff7ca31e45206ed044ee2937051
      Signed-off-by: default avatarAdarsh Saraf <adarshsaraf123@gmail.com>
    • yacovm's avatar
      [FAB-11833] Say hello to Raft OSN · 96735d2f
      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: default avataryacovm <yacovm@il.ibm.com>
  13. 17 Sep, 2018 2 commits
  14. 06 Sep, 2018 1 commit
    • Jay Guo's avatar
      [FAB-11162] Implement bare minimum Raft-based chain · 7f12d1b3
      Jay Guo authored
      This CR implements a bare minimum raft-based chain, which only
      supports single node. It does not support following features:
      - process config type message
      - raft snapshot
      - raft WAL
      - reconfigure raft
      This CR all pulls in a fake clock library for testing purpose.
      Change-Id: I5e93ff9eeb524ea1afd0348e1180fb9f4535fb5c
      Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>