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

Contradicting scalaDoc for AdminUtils.assignReplicasToBrokers

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      The documentation for AdminUtils.assignReplicasToBrokers seems to contradict itself.

      I says in the description: "As the result, if the number of replicas is equal to or greater than the number of racks, it will ensure that each rack will get at least one replica."

      Which means that it is possible to get an assignment where there's multiple replicas in a rack (if there's less racks than the replication factor).

      However, the throws clauses says: " @throws AdminOperationException If rack information is supplied but it is incomplete, or if it is not possible to assign each replica to a unique rack."

      Which seems to be contradicting the first claim.

      In practice it doesn't throw when RF < #racks so the point in the @throws clause should probably be removed.

      https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/admin/AdminUtils.scala#L121-L130

        Attachments

          Activity

            People

            • Assignee:
              tombentley Tom Bentley
              Reporter:
              cmolter Charly Molter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: