You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "J-HowHuang (via GitHub)" <gi...@apache.org> on 2026/03/03 04:25:32 UTC

[PR] [Bug fix] Fault-Domain-Aware Instance Assignment failing rebalance with minimize data movement [pinot]

J-HowHuang opened a new pull request, #17799:
URL: https://github.com/apache/pinot/pull/17799

   ## Description
   For tables using `FD_AWARE_INSTANCE_PARTITION_SELECTOR` as their partition selector in instance assignment config, it's likely to fail rebalance when `minimizeDataMovement=true` if the instances didn't change in all pools.
   
   ## Reproduce
   Run quickstart offline, for table `airlineStats_OFFLINE`, remove its `tierConfigs` and add the following `instanceAssignmentConfigMap`
   ```
   "instanceAssignmentConfigMap": {
         "OFFLINE": {
           "tagPoolConfig": {
             "tag": "DefaultTenant_OFFLINE",
             "poolBased": false,
             "numPools": 1
           },
           "replicaGroupPartitionConfig": {
             "replicaGroupBased": true,
             "numInstances": 0,
             "numReplicaGroups": 1,
             "numInstancesPerReplicaGroup": 1,
             "numPartitions": 0,
             "numInstancesPerPartition": 0,
             "minimizeDataMovement": false
           },
           "partitionSelector": "FD_AWARE_INSTANCE_PARTITION_SELECTOR",
           "minimizeDataMovement": false
         }
       }
   ```
   
   Run rebalance with minimize data movement enabled.
   Results in 
   ```
   {
     "jobId": "b6c56b27-450a-49c0-ac69-16835ed47fff",
     "status": "FAILED",
     "description": "Caught exception while fetching/calculating instance partitions: java.util.NoSuchElementException"
   }
   ```
   Controller log:
   ```
   2026/03/03 12:23:37.194 INFO [InstanceTagPoolSelector] [grizzly-http-server-2] Selecting 1 instances for table: airlineStats_OFFLINE
   2026/03/03 12:23:37.194 INFO [InstanceAssignmentDriver] [grizzly-http-server-2] No instance constraint is configured, using default hash-based-rotate instance constraint
   2026/03/03 12:23:37.194 INFO [HashBasedRotateInstanceConstraintApplier] [grizzly-http-server-2] Rotating instances for table: airlineStats_OFFLINE with hash: 802879867
   2026/03/03 12:23:37.194 INFO [FDAwareInstancePartitionSelector] [grizzly-http-server-2] Assigning 1 replica groups to 1 fault domains
   2026/03/03 12:23:37.194 INFO [FDAwareInstancePartitionSelector] [grizzly-http-server-2] Warning, normalizing isn't finished yet
   2026/03/03 12:23:37.195 WARN [TableRebalancer-airlineStats_OFFLINE-2b912476-fb58-4b47-907a-7db8f87d85c1] [grizzly-http-server-2] Caught exception while fetching/calculating instance partitions, aborting the rebalance
   java.util.NoSuchElementException
   	at java.base/java.util.TreeMap.key(TreeMap.java:1602)
   	at java.base/java.util.TreeMap.firstKey(TreeMap.java:291)
   	at org.apache.pinot.controller.helix.core.assignment.instance.FDAwareInstancePartitionSelector$CandidateQueue.<init>(FDAwareInstancePartitionSelector.java:255)
   	at org.apache.pinot.controller.helix.core.assignment.instance.FDAwareInstancePartitionSelector$ReplicaGroupBasedAssignmentState.fill(FDAwareInstancePartitionSelector.java:395)
   	at org.apache.pinot.controller.helix.core.assignment.instance.FDAwareInstancePartitionSelector.selectInstances(FDAwareInstancePartitionSelector.java:195)
   	at org.apache.pinot.controller.helix.core.assignment.instance.InstanceAssignmentDriver.getInstancePartitions(InstanceAssignmentDriver.java:154)
   	at org.apache.pinot.controller.helix.core.assignment.instance.InstanceAssignmentDriver.getInstancePartitions(InstanceAssignmentDriver.java:126)
   	at org.apache.pinot.controller.helix.core.assignment.instance.InstanceAssignmentDriver.assignInstances(InstanceAssignmentDriver.java:69)
   	at org.apache.pinot.controller.helix.core.rebalance.TableRebalancer.getInstancePartitions(TableRebalancer.java:1274)
   ```
   
   ## Change
   Add a check before `FDAwareInstancePartitionSelector$ReplicaGroupBasedAssignmentState.fill` to see if there's any instance to fill, otherwise skip.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] [Bug fix] Fault-Domain-Aware Instance Assignment failing rebalance with minimize data movement [pinot]

Posted by "J-HowHuang (via GitHub)" <gi...@apache.org>.
J-HowHuang commented on PR #17799:
URL: https://github.com/apache/pinot/pull/17799#issuecomment-3994934618

   @yashmayya Added the test and verified that it would fail without the fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] [Bug fix] Fault-Domain-Aware Instance Assignment failing rebalance with minimize data movement [pinot]

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya merged PR #17799:
URL: https://github.com/apache/pinot/pull/17799


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] [Bug fix] Fault-Domain-Aware Instance Assignment failing rebalance with minimize data movement [pinot]

Posted by "J-HowHuang (via GitHub)" <gi...@apache.org>.
J-HowHuang commented on code in PR #17799:
URL: https://github.com/apache/pinot/pull/17799#discussion_r2881536811


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/instance/FDAwareInstancePartitionSelector.java:
##########
@@ -389,6 +390,11 @@ private boolean isEmpty(int replicaGroupId, int instanceId) {
      * Fill the vacant instances
      */
     public void fill(Map<Integer, LinkedHashSet<String>> faultDomainToCandidateInstancesMap) {
+      // skip filling if there is no candidate instance, which can happen when minimize data movement is enabled and
+      // no new instances are added to any pool
+      if (faultDomainToCandidateInstancesMap.values().stream().allMatch(HashSet::isEmpty)) {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] [Bug fix] Fault-Domain-Aware Instance Assignment failing rebalance with minimize data movement [pinot]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #17799:
URL: https://github.com/apache/pinot/pull/17799#issuecomment-3988726105

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/17799?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 55.55%. Comparing base ([`7f70124`](https://app.codecov.io/gh/apache/pinot/commit/7f701245ca71c482ce71456e4e5082bfa82d5e14?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1ebc1af`](https://app.codecov.io/gh/apache/pinot/commit/1ebc1afc70bda9b82534d270073f0ee1c0be6d45?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 6 commits behind head on master.
   > :exclamation:  There is a different number of reports uploaded between BASE (7f70124) and HEAD (1ebc1af). Click for more details.
   > 
   > <details><summary>HEAD has 36 uploads less than BASE</summary>
   >
   >| Flag | BASE (7f70124) | HEAD (1ebc1af) |
   >|------|------|------|
   >|java-21|5|1|
   >|unittests1|2|1|
   >|unittests|4|1|
   >|temurin|10|1|
   >|java-11|5|0|
   >|unittests2|2|0|
   >|integration|6|0|
   >|integration1|2|0|
   >|integration2|2|0|
   >|custom-integration1|2|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #17799      +/-   ##
   ============================================
   - Coverage     63.21%   55.55%   -7.66%     
   + Complexity     1454      720     -734     
   ============================================
     Files          3183     2489     -694     
     Lines        191500   140989   -50511     
     Branches      29289    22469    -6820     
   ============================================
   - Hits         121048    78322   -42726     
   + Misses        60986    56018    -4968     
   + Partials       9466     6649    -2817     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.55% <ø> (-7.63%)` | :arrow_down: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.55% <ø> (-7.66%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.55% <ø> (-7.66%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.55% <ø> (-0.03%)` | :arrow_down: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/17799/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/17799?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] [Bug fix] Fault-Domain-Aware Instance Assignment failing rebalance with minimize data movement [pinot]

Posted by "J-HowHuang (via GitHub)" <gi...@apache.org>.
J-HowHuang commented on code in PR #17799:
URL: https://github.com/apache/pinot/pull/17799#discussion_r2882251015


##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/assignment/instance/InstanceAssignmentTest.java:
##########
@@ -1,20 +1,14 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE
+ * file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations under the License.

Review Comment:
   ah my bad



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] [Bug fix] Fault-Domain-Aware Instance Assignment failing rebalance with minimize data movement [pinot]

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya commented on code in PR #17799:
URL: https://github.com/apache/pinot/pull/17799#discussion_r2881910751


##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/assignment/instance/InstanceAssignmentTest.java:
##########
@@ -1,20 +1,14 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE
+ * file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations under the License.

Review Comment:
   Should be reverted



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org