Description
Currently it is possible to lower a topics replication factor to 0 through the use of the kafka-reassign-partitions command.
i.e.
cat increase-replication-factor.json
{"version":1,
"partitions":[
]}
kafka-reassign-partitions --zookeeper localhost:2181 --reassignment-json-file increase-replication-factor.json --execute
Topic:test PartitionCount:1 ReplicationFactor:0 Configs:
Topic: foo Partition: 0 Leader: -1 Replicas: Isr:
I for one can't think of a reason why this is something someone would do intentionally. That said I think it's worth validating that at least 1 replica remains within the replica list prior to executing the partition reassignment.