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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/ConcurrentMapPartitionUpsertMetadataManager.java:
##########
@@ -89,7 +93,12 @@ protected void doAddOrReplaceSegment(ImmutableSegmentImpl 
segment, ThreadSafeMut
               if (currentSegment == segment) {
                 if (comparisonResult >= 0) {
                   replaceDocId(segment, validDocIds, queryableDocIds, 
currentDocId, newDocId, recordInfo);
-                  return new RecordLocation(segment, newDocId, 
newComparisonValue);
+                  RecordLocation newRecordLocation = new 
RecordLocation(segment, newDocId, newComparisonValue);
+                  // Track the record location of the newly added keys
+                  if (_newlyAddedKeys.containsKey(primaryKey)) {

Review Comment:
   Let's say a newly added key in a segment is updated with a greater TS into 
the same segment. In such scenarios, we need to have the updated location of 
this key to delete the new entries in the map pointing to the right docId..



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