-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-2484] Prevent unclean leader election
https://jira.hyperledger.org/browse/FAB-2484 This fixes the bug described in: https://jira.hyperledger.org/browse/FAB-2259 Kafka ships with the `unclean.leader.election.enable` setting set to `true`. For our use case, this default is wrong as it trades consistency off for availability. Concretely, consider this worst-case scenario that goes against every proper practice: - Two brokers: B0 and B1 - A replication factor of 2 - `min.insync.replicas` set to 1 (the default) Assume B1 is the partition leader replica (though this doesn't really matter). B1 receives a batch of messages from an ordering service node, and writes them to disk. B0 does the same, replicating B1. We shut B0 down. We send a new batch of messages to the cluster (read: B1); B1 writes them to disk. We shut B1 down and then bring B0 up. If we send a new batch of messages to the cluster (read: B0), it will write them to disk using _re-using (some/all of) the offsets that B1 had used for its last batch of messages. This means we are rewriting the blockchain, which is obviously unacceptable. This changeset prevents this from happening. Change-Id: Iaa8f8a9fb3a5e001d4deeebcf2774f2a1026855c Signed-off-by: Kostas Christidis <kostas@christidis.io>
- Loading branch information
1 parent
2df8355
commit 2c9fd1b
Showing
5 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters