klsince commented on code in PR #15178: URL: https://github.com/apache/pinot/pull/15178#discussion_r1982131547
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/dedup/BasePartitionDedupMetadataManager.java: ########## @@ -283,8 +283,13 @@ public void removeSegment(IndexSegment segment) { return; } try { - if (skipSegmentOutOfTTL(segment, false)) { - return; + // segment.getSegmentMetadata().getColumnMetadataMap() will be null when offloading a temporary segment data + // manager created in BaseTableDataManager.addSegment which caused replicas to go into BAD state when + // metadataTTL is set + if (segment.getSegmentMetadata() != null && segment.getSegmentMetadata().getColumnMetadataMap() != null) { Review Comment: as we figured out that MutableSegment returns null for getColumnMetadataMap(), as it doesn't have column metadata map, we may consider to extend getMaxDedupTime() method instead of here, so caller of getMaxDedupTime() can leverage the check as well. ``` protected double getMaxDedupTime(IndexSegment segment) { if (segment instanceof MutableSegment) { // MutableSegment doesn't have columnMetadataMap to get its max dedup time, so returning the largest value seen so far to process this segment as within TTL to be conservative return _largestSeenTime.get(); } return ((Number) segment.getSegmentMetadata().getColumnMetadataMap().get(_dedupTimeColumn) .getMaxValue()).doubleValue(); } ``` -- 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: commits-unsubscr...@pinot.apache.org 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