Jackie-Jiang commented on code in PR #15903:
URL: https://github.com/apache/pinot/pull/15903#discussion_r2122236799
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -2958,15 +2958,31 @@ public void resetSegment(String tableNameWithType,
String segmentName, @Nullable
Set<String> instanceSet = parseInstanceSet(idealState, segmentName,
targetInstance);
Map<String, String> externalViewStateMap =
externalView.getStateMap(segmentName);
+ List<String> instanceFailedList = null;
for (String instance : instanceSet) {
if (externalViewStateMap == null ||
SegmentStateModel.OFFLINE.equals(externalViewStateMap.get(instance))) {
LOGGER.info("Skipping resetting for segment: {} of table: {} on
instance: {}", segmentName, tableNameWithType,
instance);
} else {
LOGGER.info("Resetting segment: {} of table: {} on instance: {}",
segmentName, tableNameWithType, instance);
- resetPartitionAllState(instance, tableNameWithType,
Collections.singleton(segmentName));
+ try {
+ resetPartitionAllState(instance, tableNameWithType,
Collections.singleton(segmentName));
+ } catch (Exception e) {
+ if (instanceFailedList == null) {
+ instanceFailedList = new ArrayList<>();
+ }
+ instanceFailedList.add(instance);
+ LOGGER.error("Failed to reset segment: {} of table: {} on instance:
{}", segmentName, tableNameWithType,
+ instance, e);
+ }
Review Comment:
Consider extracting this common logic into a helper method
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -2958,15 +2958,31 @@ public void resetSegment(String tableNameWithType,
String segmentName, @Nullable
Set<String> instanceSet = parseInstanceSet(idealState, segmentName,
targetInstance);
Map<String, String> externalViewStateMap =
externalView.getStateMap(segmentName);
+ List<String> instanceFailedList = null;
Review Comment:
(minor)
```suggestion
List<String> failedInstances = null;
```
--
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]