Jackie-Jiang commented on code in PR #11585:
URL: https://github.com/apache/pinot/pull/11585#discussion_r1325042227


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/segmentpartition/SegmentPartitionMetadataManager.java:
##########
@@ -123,16 +141,23 @@ private List<String> getOnlineServers(ExternalView 
externalView, String segment)
 
   private void computeTablePartitionInfo() {
     PartitionInfo[] partitionInfoMap = new PartitionInfo[_numPartitions];
-    Set<String> segmentsWithInvalidPartition = new HashSet<>();
+    List<String> segmentsWithInvalidPartition = new ArrayList<>();
+    List<Map.Entry<String, SegmentInfo>> newSegmentInfoEntries = new 
ArrayList<>();
+    long currentTimeMs = System.currentTimeMillis();
     for (Map.Entry<String, SegmentInfo> entry : _segmentInfoMap.entrySet()) {
       String segment = entry.getKey();
       SegmentInfo segmentInfo = entry.getValue();
       int partitionId = segmentInfo._partitionId;
-      List<String> onlineServers = segmentInfo._onlineServers;
       if (partitionId == INVALID_PARTITION_ID) {
         segmentsWithInvalidPartition.add(segment);
         continue;
       }
+      // Process new segments in the end
+      if (InstanceSelector.isNewSegment(segmentInfo._pushTimeMs, 
currentTimeMs)) {

Review Comment:
   New segment should have valid partition id. Segment ZK metadata won't be 
changed for new segment within the life cycle



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

Reply via email to