klsince commented on code in PR #13579:
URL: https://github.com/apache/pinot/pull/13579#discussion_r1676147972


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -433,29 +433,10 @@ protected void doAddSegment(ImmutableSegmentImpl segment) 
{
     _logger.info("Adding segment: {}, current primary key count: {}", 
segmentName, getNumPrimaryKeys());
     long startTimeMs = System.currentTimeMillis();
 
-    MutableRoaringBitmap validDocIds;
-    if (_enableSnapshot) {
-      validDocIds = segment.loadValidDocIdsFromSnapshot();
-      if (validDocIds != null && validDocIds.isEmpty()) {
-        _logger.info("Skip adding segment: {} without valid doc, current 
primary key count: {}",
-            segment.getSegmentName(), getNumPrimaryKeys());
-        segment.enableUpsert(this, new ThreadSafeMutableRoaringBitmap(), null);
-        return;
-      }
-    } else {
-      validDocIds = null;
-      segment.deleteValidDocIdsSnapshot();
-    }
-
     try (UpsertUtils.RecordInfoReader recordInfoReader = new 
UpsertUtils.RecordInfoReader(segment, _primaryKeyColumns,
         _comparisonColumns, _deleteRecordColumn)) {
-      Iterator<RecordInfo> recordInfoIterator;
-      if (validDocIds != null) {
-        recordInfoIterator = 
UpsertUtils.getRecordInfoIterator(recordInfoReader, validDocIds);
-      } else {
-        recordInfoIterator =
-            UpsertUtils.getRecordInfoIterator(recordInfoReader, 
segment.getSegmentMetadata().getTotalDocs());
-      }
+      Iterator<RecordInfo> recordInfoIterator =

Review Comment:
   maybe let’s wrap this removeSnapshot method in a ‘if(!enableSnapshot) {}’ 
(as reminded by Qiaochu’s question on metadataTTL, although that shouldn’t be 
affected as you analyzed) 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to