deepthi912 commented on code in PR #19504:
URL: https://github.com/apache/pinot/pull/19504#discussion_r3993306353


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -685,10 +685,12 @@ public void replaceSegment(ImmutableSegment segment, 
@Nullable ThreadSafeMutable
         revertSegmentUpsertMetadata(oldSegment, segmentName, 
validDocIdsForOldSegment);
         return;
       }
-      _logger.warn("Found {} primary keys not replaced for segment: {}",
-          validDocIdsForOldSegment.getCardinality(), segmentName);
-      updateInconsistentRowsMetric(segmentName, 
validDocIdsForOldSegment.getCardinality());
-      removeSegment(oldSegment, validDocIdsForOldSegment);
+      int numKeysStillNotReplaced =
+          removeSegmentAndGetNumKeysRemoved(oldSegment, 
validDocIdsForOldSegment);
+      if (numKeysStillNotReplaced > 0) {

Review Comment:
   But even if it points to another segment during removal, that means that 
during update key hasn't seen the right previous location, we need to show all 
the keys that weren't replaced right not just pointing to consuming segment?



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -685,10 +685,12 @@ public void replaceSegment(ImmutableSegment segment, 
@Nullable ThreadSafeMutable
         revertSegmentUpsertMetadata(oldSegment, segmentName, 
validDocIdsForOldSegment);
         return;
       }
-      _logger.warn("Found {} primary keys not replaced for segment: {}",
-          validDocIdsForOldSegment.getCardinality(), segmentName);
-      updateInconsistentRowsMetric(segmentName, 
validDocIdsForOldSegment.getCardinality());
-      removeSegment(oldSegment, validDocIdsForOldSegment);
+      int numKeysStillNotReplaced =
+          removeSegmentAndGetNumKeysRemoved(oldSegment, 
validDocIdsForOldSegment);
+      if (numKeysStillNotReplaced > 0) {

Review Comment:
   But even if it points to another segment during removal, that means that 
during update key hasn't seen the right previous location, we need to show all 
the keys that weren't replaced right not just pointing to consuming segment in 
the current location?



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