Skip to content

Integer Overflow with WAGED Computation #3084

@ngngwr

Description

@ngngwr

Describe the bug

Waged computation fails with capacity not available issue when the total capacity of instances overflow the integer limit

To Reproduce

  1. Create 10 instances with
 "mapFields" : {
    "INSTANCE_CAPACITY_MAP": {
       "DISK": "300000000"
    }
   },
  1. Create one resource to be rebalanced using WAGED

Expected behavior

Rebalance Failure with capacity issues for the capacity param breaching integer limit

org.apache.helix.HelixRebalanceException: The cluster does not have enough DISK capacity for all partitions.  Failure Type: FAILED_TO_CALCULATE
        at org.apache.helix.controller.rebalancer.waged.constraints.ConstraintBasedAlgorithm.calculate(ConstraintBasedAlgorithm.java:82) ~[helix-core-1.4.4-SNAPSHOT.jar:1.4.4-SNAPSHOT]
        at org.apache.helix.controller.rebalancer.util.WagedRebalanceUtil.calculateAssignment(WagedRebalanceUtil.java:50) ~[helix-core-1.4.4-SNAPSHOT.jar:1.4.4-SNAPSHOT]
        at org.apache.helix.controller.rebalancer.waged.PartialRebalanceRunner.doPartialRebalance(PartialRebalanceRunner.java:164) ~[helix-core-1.4.4-SNAPSHOT.jar:1.4.4-SNAPSHOT]
        at org.apache.helix.controller.rebalancer.waged.PartialRebalanceRunner.lambda$partialRebalance$0(PartialRebalanceRunner.java:104) ~[helix-core-1.4.4-SNAPSHOT.jar:1.4.4-SNAPSHOT]
        at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions