1) With acks=-1
Kafka will accept records as long as there are min.insync.replicas
in-sync replicas.
So assuming min.insync.replicas
is 1 or 2 for your topic, with a single replica out of sync, yes the record will be accepted by Kafka
2) In a normal case, Kafka always tries to keep all replicas in-sync. If that's not happening then you want to check the broker that is hosting the out-of-sync replica as something is wrong. Is this broker running? Is it healthy? Is it overloaded? Are other partitions on this broker also out-of-sync?
Older versions of Kafka also had some replication issues which could cause out of sync replicas. A good workaround these is to force a controller re-election:
zookeeper-shell [ZK_HOST:ZK_POST] rmr /controller