You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "jtao15 (via GitHub)" <gi...@apache.org> on 2023/02/23 00:49:19 UTC

[GitHub] [pinot] jtao15 commented on a diff in pull request #10303: Add excludeReplacedSegments param into table metadata API

jtao15 commented on code in PR #10303:
URL: https://github.com/apache/pinot/pull/10303#discussion_r1115144518


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -265,13 +269,31 @@ public boolean isSegmentDeletedRecently(String segmentName) {
 
   @Override
   public List<SegmentDataManager> acquireAllSegments() {
+    return acquireAllSegments(false);
+  }
+
+  @Override
+  public List<SegmentDataManager> acquireAllSegments(boolean excludeReplacedSegments) {
     List<SegmentDataManager> segmentDataManagers = new ArrayList<>();
     for (SegmentDataManager segmentDataManager : _segmentDataManagerMap.values()) {
       if (segmentDataManager.increaseReferenceCount()) {
         segmentDataManagers.add(segmentDataManager);
       }
     }
-    return segmentDataManagers;
+    // Fetch the segment lineage metadata, and conditionally filter out replaced segments based on segment lineage.
+    SegmentLineage segmentLineage = SegmentLineageAccessHelper.getSegmentLineage(_propertyStore, _tableNameWithType);

Review Comment:
   +1 on this, it's also possible that different servers get different versions of the lineage metadata, and controllers return incorrect results due to this.



-- 
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-unsubscribe@pinot.apache.org

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


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