mcvsubbu commented on a change in pull request #6647: URL: https://github.com/apache/incubator-pinot/pull/6647#discussion_r587956134
########## File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java ########## @@ -268,56 +269,69 @@ public void addSegment(String segmentName, TableConfig tableConfig, IndexLoading LoaderUtils.reloadFailureRecovery(indexDir); boolean isLLCSegment = SegmentName.isLowLevelConsumerSegmentName(segmentName); - LLCSegmentName llcSegmentName = null; - PartitionUpsertMetadataManager partitionUpsertMetadataManager = null; - if (isLLCSegment) { - llcSegmentName = new LLCSegmentName(segmentName); - if (_tableUpsertMetadataManager != null) { - partitionUpsertMetadataManager = - _tableUpsertMetadataManager.getOrCreatePartitionManager(llcSegmentName.getPartitionId()); + if (indexDir.exists()) { + // Segment already exists on disk + if (realtimeSegmentZKMetadata.getStatus() == Status.DONE) { + // Metadata has been committed, load the local segment + try { + addSegment(ImmutableSegmentLoader.load(indexDir, indexLoadingConfig, schema)); + return; + } catch (Exception e) { + if (isLLCSegment) { + // For LLC and segments, delete the local copy and download a new copy from the controller + FileUtils.deleteQuietly(indexDir); + if (e instanceof V3RemoveIndexException) { + _logger.info("Unable to remove index from V3 format segment: {}, downloading a new copy", segmentName, e); Review comment: Why do we need to log the exception here? ---------------------------------------------------------------- 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