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

Refactor the StreamsPartitionAssignor for more code sharing with the FutureStreamsPartitionAssignor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • streams
    • None

    Description

      Frequently when fixing bugs in the StreamsPartitionAssignor, version probing, or other assignor-related matters, we make a change in the StreamsPartitionAssignor and re-run the version_probing_upgrade system test only to see that the issue is not fixed because we forgot to mirror that change in the FutureStreamsPartitionAssignor. Worse yet, we are making a new change or fixing something that doesn't directly affect version probing, so we update only the StreamsPartitionAssignor and don't even run the version probing test, and discover later the version probing system test has started failing. Then we often waste time digging through old changes just to discover it was just because we forgot to copy any changes to the StreamsUpgradeTest classes (includes also it's future version of the SubscriptionInfo and AssignmentInfo classes)

       

      We should refactor the StreamsPartitionAssignor so that the future version can rely more heavily on the original class. This will probably involve either or all of:

      • making the class's latestSupportedVersion configurable in the constructor, to be used only by the system test. this will probably also require making it configurable in some other classes such as SubscriptionInfo and AssignmentInfo
      • breaking up the methods such as onAssignment and assign so that the future assignor can call smaller pieces at a time – part of the original problem is that the normal assignor will throw an exception partway through these methods if the latest version is a "future" one, so we end up having to call the method, catch the exception, and recode the remainder of the work in that method

      Attachments

        Activity

          People

            Unassigned Unassigned
            ableegoldman A. Sophie Blee-Goldman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: