J-HowHuang commented on code in PR #16722:
URL: https://github.com/apache/pinot/pull/16722#discussion_r2311264132
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/relocation/SegmentRelocator.java:
##########
@@ -182,34 +183,46 @@ BlockingQueue<String> getWaitingQueue() {
return _waitingQueue;
}
- private void rebalanceTable(String tableNameWithType) {
+ @VisibleForTesting
+ void rebalanceTable(String tableNameWithType) {
TableConfig tableConfig =
_pinotHelixResourceManager.getTableConfig(tableNameWithType);
Preconditions.checkState(tableConfig != null, "Failed to find table config
for table: %s", tableNameWithType);
+ RebalanceConfig rebalanceConfig = new RebalanceConfig();
+
boolean relocate = false;
- if (TierConfigUtils.shouldRelocateToTiers(tableConfig)) {
- relocate = true;
- LOGGER.info("Relocating segments to tiers for table: {}",
tableNameWithType);
- }
if (tableConfig.getTableType() == TableType.REALTIME
&&
InstanceAssignmentConfigUtils.shouldRelocateCompletedSegments(tableConfig)) {
relocate = true;
LOGGER.info("Relocating COMPLETED segments for table: {}",
tableNameWithType);
}
+ if (TierConfigUtils.shouldRelocateToTiers(tableConfig)) {
+ relocate = true;
+ rebalanceConfig.setUpdateTargetTier(true);
+ LOGGER.info("Relocating segments to tiers for table: {}",
tableNameWithType);
+ } else {
+ List<SegmentZKMetadata> segmentsZKMetadata =
_pinotHelixResourceManager.getSegmentsZKMetadata(tableNameWithType);
Review Comment:
@rhodo Do you have any input to this point? Because I think this was
reported as a bug first, so maybe the expectation at some point was to
automatically relocate the segments to local tier whenever config removed?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]