tibrewalpratik17 commented on code in PR #13579:
URL: https://github.com/apache/pinot/pull/13579#discussion_r1676165564
##########
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:
Done! I can think of a scenario where this would make sense. Say, a
within-TTL segment gets snapshot removed (without this condition) but it
restarts after moving out-of-TTL but before the next segment commit. This would
help in that case.
--
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]