Reply
New Contributor
Posts: 4
Registered: ‎11-21-2018
Accepted Solution

min.insync.replicas - Check if taken into account after changing the value

[ Edited ]

Hi,

 

I need to know if the "min.insync.replicas" configured with a new value (2) is taking effect on all of our Topics that was already created before the change of this value.

 

What I've already done:

- I noticed that when I execute the command:

kafka-topics --zookeeper ServerName:2181 --topic TOPICTEST --describe

 

I have this result:

Topic:TOPICTEST    PartitionCount:3        ReplicationFactor:3 Configs:retention.ms=172800000

 

==> I don't see the "min.insync.replicas=2" result

 

I see it only when I alter the topic this way:

kafka-topics --alter --zookeeper ServerName:2181 --topic TOPICTEST --config min.insync.replicas=2

 

Then the result is of the same --describe is:

Topic:TOPICTEST    PartitionCount:3        ReplicationFactor:3 Configs:retention.ms=172800000,min.insync.replicas=2

 

Which confirms that the min.insync.replicas value has been taken into account.

 

How can I check the new default value is applied as planned?

 

Thanks,

 

Jo

 

 

Master
Posts: 377
Registered: ‎07-01-2015

Re: min.insync.replicas - Check if taken into account after changing the value

I think by default this setting your configuration is not set by default. Therefore after the topic was created you dont see this property on the topic. After you explicitly set the property it is applied by the Kafka,.

If you want to set it service wide, check out the docs https://www.cloudera.com/documentation/kafka/latest/topics/kafka_ha.html
New Contributor
Posts: 4
Registered: ‎11-21-2018

Re: min.insync.replicas - Check if taken into account after changing the value

[ Edited ]
Thanks @Tomas79,

When launching the command again (after having changed the default value from 1 to 2) and create a new topic "TOPICtest2" afterward, 

I still don't see the property in the result of the command:

kafka-topics --zookeeper ServerName:2181 --topic TOPICtest2 --describe

.

.

Result:

Topic:TOPICTEST    PartitionCount:3        ReplicationFactor:3 Configs:retention.ms=172800000

 

Does this mean that the value (min.insync.replicas=2) is not showed when the topic has the default value?

 

Master
Posts: 377
Registered: ‎07-01-2015

Re: min.insync.replicas - Check if taken into account after changing the value

Yes, it could be the case.
New Contributor
Posts: 4
Registered: ‎11-21-2018

Re: min.insync.replicas - Check if taken into account after changing the value


@Tomas79 wrote:
Yes, it could be the case.

Thanks @Tomas79, I need to make sure because all teams in my compagny are pressuring me about this answer :) They need me to make sure the topics are with the min.insync.replicas=2

If you have a way to check that, it would be perfect.

Master
Posts: 377
Registered: ‎07-01-2015

Re: min.insync.replicas - Check if taken into account after changing the value

I think you can test it on the newly created topic, try to shut down the following replicas, so that only the leader will be the ISR and since you have a min.insync set to 2 it should refuse to accept write. Otherwise, without this option your leader can tolerate the failure of the followers and accept the writes to the topic
New Contributor
Posts: 4
Registered: ‎11-21-2018

Re: min.insync.replicas - Check if taken into account after changing the value

Thanks a lot for your help and your time @Tomas79, I will try this solution.

Announcements
New solutions