During a rebalance a partition moves from one consumer to another. If the old owner processed records but did not commit the offset, the new one reads them again. Kafka warns in advance: before giving partitions away, the consumer gets an onPartitionsRevoked call.