Questions tagged [raft]

A distributed consensus protocol designed to be easy to understand. It's equivalent to Paxos in fault-tolerance and performance.

Click for source

Raft is a consensus algorithm that is designed to be easy to understand. It's equivalent to Paxos in fault-tolerance and performance. The difference is that it's decomposed into relatively independent subproblems, and it cleanly addresses all major pieces needed for practical systems. We hope Raft will make consensus available to a wider audience, and that this wider audience will be able to develop a variety of higher quality consensus-based systems than are available today.

Consensus is a fundamental problem in fault-tolerant distributed systems. Consensus involves multiple servers agreeing on values. Once they reach a decision on a value, that decision is final. Typical consensus algorithms make progress when any majority of their servers are available; for example, a cluster of 5 servers can continue to operate even if 2 servers fail. If more servers fail, they stop making progress (but will never return an incorrect result).

Consensus typically arises in the context of replicated state machines, a general approach to building fault-tolerant systems. Each server has a state machine and a log. The state machine is the component that we want to make fault-tolerant, such as a hash table. It will appear to clients that they are interacting with a single, reliable state machine, even if a minority of the servers in the cluster fail. Each state machine takes as input commands from its log. In our hash table example, the log would include commands like set x to 3. A consensus algorithm is used to agree on the commands in the servers' logs. The consensus algorithm must ensure that if any state machine applies set x to 3 as the nth command, no other state machine will ever apply a different nth command. As a result, each state machine processes the same series of commands and thus produces the same series of results and arrives at the same series of states.

259 questions
4
votes
1 answer

Error while migrating form kafka to RAFT in Hyperledger fabirc

I am migrating from kafka to raft, When I have changed state from "NORMAL" to "STATE_MAINTENANCE"  and created the final expected envelope as per the procedure. Note: We are using BYFN script HF version: 1.4.3 My CLI pointed to Org1MSP, I signed…
PAVAN
  • 771
  • 4
  • 14
4
votes
1 answer

Why Raft should grant vote when voteFor is candidateId?

I am not sure if I understand the RequestVote RPC detail in Raft correctly. In the paper, it says Receiver implementation: 1. Reply false if term < currentTerm (§5.1) 2. If votedFor is null or candidateId, and candidate’s log is at least as…
pikatao
  • 344
  • 6
  • 12
4
votes
1 answer

consensus algorithm: what will happen if an odd cluster becomes even because of a node failure?

Consensus algorithm (e.g. raft) requires the cluster contains an odd number of nodes to avoid the split-brain problem. Say I have a cluster of 5 nodes, what will happen if only one node fails? The cluster has 4 nodes now, which breaks the odd…
zx_wing
  • 1,918
  • 3
  • 26
  • 39
4
votes
1 answer

In Raft distributed consensus, what do I set votedFor to?

I am trying to implement the Raft consensus algorithm. Here is my general understanding around all the times we set the term and votedFor attributes of a server's state: Upon startup term is 0 and votedFor is null Upon a server's election timeout,…
Ozymandias
  • 2,533
  • 29
  • 33
4
votes
1 answer

Raft leaders commit a no-op entry at the beginning of their term

Recently I have read a paper on the Raft consensus algorithm. The new leader does not know what is the current commit index. How does a no-op solves this problem?
Chuckie Li
  • 45
  • 7
4
votes
2 answers

Does the Raft consensus protocol handle nodes that lost contact to the leader but not to the other nodes?

In case of network partitions, Raft stays consistent. But what does happen if only a single node loses contact only to the leader, becomes a candidate and calls for votes? This is the setup, I adjusted the examples from…
spettekaka
  • 411
  • 3
  • 11
4
votes
1 answer

In RAFT is it possible to have a majority consensus on a log entry but the entry is not committed?

Consider this simulation in the official raft webpage Why is term 2 index 1 not committed despite S2 (leader) , S3 and S4 agreeing on the log? I run this multiple minutes to make sure all communication has taken place. Weirdly enough, if I add one…
Jal
  • 2,174
  • 1
  • 18
  • 37
4
votes
1 answer

how do i do an atomic update with etcd

I am trying to understand what an 'atomic' update is in terms on etcd. When I think 'atomic', I think there is a 'before' and an 'after' (there isn't a during, and if the update fails, it is still 'before'). Here is an example: curl -s -XPUT…
Greg
  • 6,571
  • 2
  • 27
  • 39
4
votes
1 answer

What's the benefit of advanced master election algorithms over bully algorithm?

I read how current master election algorithms like Raft, Paxos or Zab elect master on a cluster and couldn't understand why they use sophisticated algorithms instead of simple bully algorithm. I'm developing a cluster library and use UDP Multicast…
4
votes
3 answers

RAFT consensus protocol - Should entries be durable before commiting

I have the following query about implementation RAFT: Consider the following scenario\implementation: RAFT leader receives a command entry, it appends the entry to an in-memory array It then sends the entries to followers (with the heartbeat) The…
coder_bro
  • 10,503
  • 13
  • 56
  • 88
3
votes
1 answer

Zookeeper vs kafka raft

Why ZooKeeper was replaced with kafka-raft for metadata management in Apache kafka ? I went through the articles on apache's blog ( apache.org ) as well, but couldn't find exact and concise reasons. Looking forward to some good insights.
Amit kumar
  • 2,169
  • 10
  • 25
  • 36
3
votes
1 answer

What if log replication out-of-order of etcd raft?

I'm the newbie in etcd and have some confusion points about log replication: For example, leader send out {term:2,index:3} and then {term:2,index:4}, the majority respond in order too. But due to network delay, leader receive the responses out of…
3
votes
2 answers

Simple leader election (Stateless leader election)

I am building an app in golang that I would like to be fault-tolerant. I looked at different algorithms like RAFT and Paxos and their implementations in golang (etcd's raft, hashicorp's raft), but I feel like they might be an overkill for my…
Aibek
  • 318
  • 3
  • 11
3
votes
3 answers

leader not electing hyperLedger fabric raft ordering service

When i try to deploy fabric-raft ordering service, it shows these logs. it starts election repetitively without electing a leader. i tried changing heartbeat time to 1 sec and election time to 10 sec but that is not working. then i tried to…
3
votes
1 answer

Hyperledger Fabric: adding one more raft orderer

I want to add one more raft orderer to my network: I fetch the config block and convert it to json format. When I want to add the new orderer, I don't know what kind of format I should use for client.crt and server.crt. { …
Pouya Shojaei
  • 307
  • 1
  • 10
1 2
3
17 18