somandal commented on code in PR #11578:
URL: https://github.com/apache/pinot/pull/11578#discussion_r1374921766
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -1735,20 +1735,29 @@ private void assignInstances(TableConfig tableConfig,
boolean override) {
for (InstancePartitionsType instancePartitionsType :
instancePartitionsTypesToAssign) {
boolean hasPreConfiguredInstancePartitions =
TableConfigUtils.hasPreConfiguredInstancePartitions(tableConfig,
instancePartitionsType);
+ boolean isPreConfigurationBasedAssignment =
+
InstanceAssignmentConfigUtils.isMirrorServerSetAssignment(tableConfig,
instancePartitionsType);
InstancePartitions instancePartitions;
if (!hasPreConfiguredInstancePartitions) {
instancePartitions =
instanceAssignmentDriver.assignInstances(instancePartitionsType,
instanceConfigs, null);
LOGGER.info("Persisting instance partitions: {}",
instancePartitions);
- InstancePartitionsUtils.persistInstancePartitions(_propertyStore,
instancePartitions);
} else {
String referenceInstancePartitionsName =
tableConfig.getInstancePartitionsMap().get(instancePartitionsType);
- instancePartitions =
-
InstancePartitionsUtils.fetchInstancePartitionsWithRename(_propertyStore,
referenceInstancePartitionsName,
-
instancePartitionsType.getInstancePartitionsName(rawTableName));
- LOGGER.info("Persisting instance partitions: {} (referencing {})",
instancePartitions,
- referenceInstancePartitionsName);
- InstancePartitionsUtils.persistInstancePartitions(_propertyStore,
instancePartitions);
+ if (isPreConfigurationBasedAssignment) {
+ InstancePartitions preConfiguredInstancePartitions =
+
InstancePartitionsUtils.fetchInstancePartitionsWithRename(_propertyStore,
+ referenceInstancePartitionsName,
instancePartitionsType.getInstancePartitionsName(rawTableName));
+ instancePartitions =
instanceAssignmentDriver.assignInstances(instancePartitionsType,
instanceConfigs, null,
+ preConfiguredInstancePartitions);
+ LOGGER.info("Persisting instance partitions: {}",
instancePartitions);
Review Comment:
nit: would it be helpful for debugging to also print the referencing list
here like we do with the else condition?
--
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]