mcvsubbu commented on a change in pull request #7086:
URL: https://github.com/apache/incubator-pinot/pull/7086#discussion_r657604714



##########
File path: 
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/BaseTaskExecutor.java
##########
@@ -56,4 +59,15 @@ protected Schema getSchema(String tableName) {
     Preconditions.checkState(schema != null, "Failed to find schema for table: 
%s", tableName);
     return schema;
   }
+
+  protected long getSegmentCrc(String tableNameWithType, String segmentName) {
+    TableType tableType = 
TableNameBuilder.getTableTypeFromTableName(tableNameWithType);
+    SegmentZKMetadata segmentZKMetadata = tableType == TableType.OFFLINE ? 
ZKMetadataProvider
+        .getOfflineSegmentZKMetadata(MINION_CONTEXT.getHelixPropertyStore(), 
tableNameWithType, segmentName)
+        : ZKMetadataProvider
+            
.getRealtimeSegmentZKMetadata(MINION_CONTEXT.getHelixPropertyStore(), 
tableNameWithType, segmentName);
+    Preconditions.checkState(segmentZKMetadata != null, "Failed to find 
segment metadata for table: %s, segment: %s",

Review comment:
       Do not add this as pre-condition. Just log a warning and return success. 
If the metadata is not there, it is likely that the segment has been deleted. 
If you throw exception, helix will keep retrying this forever.




-- 
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.

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



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

Reply via email to