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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/ConcurrentMapPartitionUpsertMetadataManager.java:
##########
@@ -245,6 +248,18 @@ public void doRemoveExpiredPrimaryKeys() {
     }
   }
 
+  protected void revertCurrentSegmentUpsertMetadata() {
+    _logger.info("Reverting Upsert metadata for {} keys", 
_previousKeyToRecordLocationMap.size());
+    // Revert to previous locations present in other segments
+    // For the newly added keys into the segment, it will be considered new 
when metadata is replaced again
+    _primaryKeyToRecordLocationMap.putAll(_previousKeyToRecordLocationMap);

Review Comment:
   Good point, we should be updating the validDocs of the old segment as well. 
Reason for not doing that is because we might need record info of the documents 
in the old segment. So assumed having little bit dip and pause in showing the 
data is acceptable.



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