Skip to content

Commit 89f9a10

Browse files
committed
[FAB-1419] Set appropriate ACK level for brokers
https://jira.hyperledger.org/browse/FAB-1419 By default the partition leader (i.e. the Kafka broker responsible for maintainig a chain) waits only for the local commit to succeed before responding. The right setting to maximize the reliability of data delivery is to have the partition leader wait for all in-sync replicas (backups) to get a message before sending back to the producer an acknowledgement or an error. Change-Id: I1bc045ef883c39cac3fec2c31f3e9f329ba972c4 Signed-off-by: Kostas Christidis <[email protected]>
1 parent c6f2565 commit 89f9a10

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

orderer/kafka/util.go

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ func newBrokerConfig(kafkaVersion sarama.KafkaVersion, chosenStaticPartition int
2929
brokerConfig := sarama.NewConfig()
3030

3131
brokerConfig.Version = kafkaVersion
32+
// Set the level of acknowledgement reliability needed from the broker.
33+
// WaitForAll means that the partition leader will wait till all ISRs
34+
// got the message before sending back an ACK to the sender.
35+
brokerConfig.Producer.RequiredAcks = sarama.WaitForAll
3236
// A partitioner is actually not needed the way we do things now,
3337
// but we're adding it now to allow for flexibility in the future.
3438
brokerConfig.Producer.Partitioner = newStaticPartitioner(chosenStaticPartition)

0 commit comments

Comments
 (0)