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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/ConcurrentMapPartitionUpsertMetadataManager.java:
##########
@@ -139,13 +144,20 @@ protected void doAddOrReplaceSegment(ImmutableSegmentImpl 
segment, ThreadSafeMut
                   currentSegmentName, getAuthoritativeCreationTime(segment),
                   getAuthoritativeCreationTime(currentSegment)))) {
                 replaceDocId(segment, validDocIds, queryableDocIds, 
currentSegment, currentDocId, newDocId, recordInfo);
+                if (currentSegment != segment) {
+                  _previousKeyToRecordLocationMap.put(primaryKey, 
currentRecordLocation);
+                }
                 return new RecordLocation(segment, newDocId, 
newComparisonValue);
               } else {
+                if (currentSegment != segment) {
+                  _previousKeyToRecordLocationMap.put(primaryKey, 
currentRecordLocation);
+                }
                 return currentRecordLocation;
               }
             } else {
               // New primary key
               addDocId(segment, validDocIds, queryableDocIds, newDocId, 
recordInfo);
+              _newlyAddedKeys.add(segment);

Review Comment:
   `_newlyAddedKeys.add(primaryKey)`?



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