Kafka medium
What is the primary operational risk of setting `unclean.leader.election.enable=true` on a critical production cluster?
- A The entire cluster will become stuck in a permanent 'Restart' loop.
- B Data Loss: If all in-sync replicas are unavailable, an out-of-sync replica (which is behind on data) can be promoted to Leader, effectively overwriting or deleting any newer messages that hadn't been copied to it.
- C The cluster will stop accepting any Consumer connections, even if the Leader is healthy.
- D It forces all Producers to use `acks=0` regardless of their client configuration.
Answer: B. Data Loss: If all in-sync replicas are unavailable, an out-of-sync replica (which is behind on data) can be promoted to Leader, effectively overwriting or deleting any newer messages that hadn't been copied to it.
This is the 'Availability vs Consistency' dilemma. Set to `true`, you stay online at the cost of losing some data. Set to `false` (safer), the partition remains offline until a 'clean' replica recovers, ensuring no data loss occurs.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When implementing 'Exactly-Once Semantics' (EOS) in a Kafka stream, what is the role of the `isolation.level=read_committed` setting on the Consumer?
- Historically, which external service was required by Kafka to manage cluster hierarchy, metadata, and leader election status?
- Once a message is successfully appended to a Kafka partition log, what is its mutability status?
- In a Kafka cluster, what is the role of a 'Broker'?
- What is the primary indicator of a bottleneck in a Kafka consumer's processing logic?
- What is the primary architectural role of Apache Kafka in a distributed system?