Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5091

ReassignPartitionsCommand should protect against empty replica list assignment

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0.0
    • tools
    • None

    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":[

      {"topic":"foo","partition":0,"replicas":[]}

      ]}

      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.

      Attachments

        Activity

          People

            huxi_2b huxihx
            Ryan P Ryan P
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: