Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-1678 add new options for reassign partition to better manager dead brokers
  3. KAFKA-1792

change behavior of --generate to produce assignment config with fair replica distribution and minimal number of reassignments

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • tools
    • None

    Description

      Current implementation produces fair replica distribution between specified list of brokers. Unfortunately, it doesn't take
      into account current replica assignment.

      So if we have, for instance, 3 brokers id=[0..2] and are going to add fourth broker id=3,
      generate will create an assignment config which will redistribute replicas fairly across brokers [0..3]
      in the same way as those partitions were created from scratch. It will not take into consideration current replica
      assignment and accordingly will not try to minimize number of replica moves between brokers.

      As proposed by charmalloc this should be improved. New output of improved --generate algorithm should suite following requirements:

      • fairness of replica distribution - every broker will have R or R+1 replicas assigned;
      • minimum of reassignments - number of replica moves between brokers will be minimal;

      Example.
      Consider following replica distribution per brokers [0..3] (we just added brokers 2 and 3):

      • broker - 0, 1, 2, 3
      • replicas - 7, 6, 0, 0

      The new algorithm will produce following assignment:

      • broker - 0, 1, 2, 3
      • replicas - 4, 3, 3, 3
      • moves - -3, -3, +3, +3

      It will be fair and number of moves will be 6, which is minimal for specified initial distribution.

      The scope of this issue is:

      • design an algorithm matching the above requirements;
      • implement this algorithm and unit tests;
      • test it manually using different initial assignments;

      Attachments

        1. generate_alg_tests.txt
          12 kB
          Dmitry Pekar
        2. KAFKA-1792_2014-12-03_19:24:56.patch
          21 kB
          Dmitry Pekar
        3. KAFKA-1792_2014-12-08_13:42:43.patch
          25 kB
          Dmitry Pekar
        4. KAFKA-1792_2014-12-19_16:48:12.patch
          34 kB
          Dmitry Pekar
        5. KAFKA-1792_2015-01-14_12:54:52.patch
          39 kB
          Dmitry Pekar
        6. KAFKA-1792_2015-01-27_19:09:27.patch
          48 kB
          Dmitry Pekar
        7. KAFKA-1792_2015-02-13_21:07:06.patch
          55 kB
          Dmitry Pekar
        8. KAFKA-1792_2015-02-26_16:58:23.patch
          66 kB
          Dmitry Pekar
        9. KAFKA-1792.patch
          12 kB
          Dmitry Pekar
        10. rebalance_use_cases.txt
          2 kB
          Dmitry Pekar

        Issue Links

          Activity

            People

              Dmitry Pekar Dmitry Pekar
              Dmitry Pekar Dmitry Pekar
              Neha Narkhede Neha Narkhede
              Votes:
              4 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated: