Closed GrantPSpencer closed 2 weeks ago
@junkaixue Updated 2 other areas where getReplicas was called without handling possible number format exception
Failed due to 2 flaky tests: updateInstance - https://github.com/apache/helix/issues/2744
partitionAssignmentAPI afterTest - https://github.com/apache/helix/issues/2754
Error: Test failed: updateInstance(org.apache.helix.rest.server.TestPerInstanceAccessor) Time elapsed: 0.526 s <<< FAILURE!
Error: Test failed: afterTest(org.apache.helix.rest.server.TestPartitionAssignmentAPI) Time elapsed: 12.493 s <<< FAILURE!
Pull request approved @junkaixue Commit message: Handle ANY_LIVEINSTANCE by calling getReplicaCount
Issues
2816
partitionAssignment fails to calculate when there is FULL_AUTO resource that has
ANY_LIVEINSTANCE
for replica count.Description
partitionAssignment fails due to
Integer.parseInt(idealState.getReplicas())
in thegetIdealAssignmentForFullAuto
method.idealState.getReplicas()
returns"ANY_LIVEINSTANCE"
which then fails to be parsed to an int.This change switches to the getReplicaCount() method which takes a default value if the replica count is ANY_LIVEINSTANCE.
Tests
Added a resource that utilizes ANY_LIVEINSTANCE into the testComputePartitionAssignmentMaintenanceMode test method. Without the changes to getReplicas()
Changes that Break Backward Compatibility (Optional)
Change to the return value of getReplicas when called on a resource with ANY_LIVEINSTANCE as its replica count.
Commits
Code Quality