liveBook · Manning

Min.insync.replicas

As explained in Kafka Streams in Action, Second Edition

min.insync.replicas is a Kafka topic configuration specifying the minimum number of in-sync replicas required for a write to succeed.

min.insync.replicas sets the minimum number of in-sync replicas required before Kafka considers a record committed. The leader counts as a replica, so the setting controls how many replicas must be available when a produce request arrives. section 2.9.1

Use the setting to constrain writes when replicas fall behind:

  • With the default value of 1, a topic with replication factor 3 and acks=all can accept a record after only the leader acknowledges it. section 2.9.1
  • With min.insync.replicas=2, the leader accepts a produce request only when at least two replicas are in sync. section 2.9.1
  • If the threshold is unavailable, the leader rejects the request with NotEnoughReplicasException, and the producer retries it. section 2.9.1

Replication factor 3 with min.insync.replicas=2

Two followers lag enough to leave the in-sync replica set. Although the producer uses acks=all, the leader refuses a new batch because only one replica remains in sync. The write succeeds after enough replicas catch up, increasing durability while potentially reducing availability. section 2.9.1 section 4.2.1

Figure 2.17 Setting the min ISR to a value greater than 1 increases data durability.
figure

Use the replication illustration to trace how requiring more than one in-sync replica increases data durability. section 2.9.1

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains leader counting, ISR checks, rejected writes, retries, and durability trade-offs, stopping short of client implementation details.
Examples
Uses replication factor 3 with acks=all, contrasting the default threshold of 1 with min.insync.replicas=2.
What it assumes
Assumes Kafka topics, partitions, replicas, leaders, followers, and producer acknowledgments; defines the minimum ISR rule directly.
What you can do after
Operate/configure Kafka topics to trade write availability for stronger durability and recognize insufficient-replica failures.
How it connects
Connects Kafka replication, leaders, followers, in-sync replicas, replication factor, producer acknowledgments, and retries.

Also explained in

Compare how 3 books explain min.insync.replicas →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.