Uploaded image for project: 'Apache Helix'
  1. Apache Helix
  2. HELIX-563

Throw more meaningful exceptions when AutoRebalanceStrategy#computePartitionAssignment inputs are invalid

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6.4
    • 0.6.5
    • None
    • None

    Description

      We hit the following NPE when the input for AutoRebalanceStrategy#computePartitionAssignment is invalid:

      java.lang.NullPointerException
              at org.apache.helix.controller.strategy.AutoRebalanceStrategy$Node.access$300(AutoRebalanceStrategy.java:571)
              at org.apache.helix.controller.strategy.AutoRebalanceStrategy.computeExistingNonPreferredPlacement(AutoRebalanceStrategy.java:437)
              at org.apache.helix.controller.strategy.AutoRebalanceStrategy.computePartitionAssignment(AutoRebalanceStrategy.java:122)
      ...
      

      The particular problem is curMapping.keySet() is not a subset of allPartitions in the following code snippet:

      AutoRebalanceStrategy strategy = new AutoRebalanceStrategy(.., allPartitions,...)
      strategy.computePartitionAssignment(..., curMapping, ...)
      

      Attachments

        Activity

          People

            dafu Zhen Zhang
            dafu Zhen Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: