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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/ConcurrentMapPartitionUpsertMetadataManagerForConsistentDeletes.java:
##########
@@ -183,8 +179,16 @@ protected void doAddOrReplaceSegment(ImmutableSegmentImpl 
segment, ThreadSafeMut
                   currentSegmentName, getAuthoritativeCreationTime(segment),
                   getAuthoritativeCreationTime(currentSegment)))) {
                 replaceDocId(segment, validDocIds, queryableDocIds, 
currentSegment, currentDocId, newDocId, recordInfo);
-                return new RecordLocation(segment, newDocId, 
newComparisonValue,
+                RecordLocation newRecordLocation = new RecordLocation(segment, 
newDocId, newComparisonValue,
                     
RecordLocation.incrementSegmentCount(currentDistinctSegmentCount));
+                // Track previous location for revert purposes:
+                // - If current key is in consuming segment: Don't track - key 
is moving to immutable segment,
+                //   consuming segment no longer owns it, so no revert needed 
for this key
+                // - If current key is in immutable segment: Track current 
location to enable revert if needed
+                if (!(currentSegment instanceof MutableSegment)) {

Review Comment:
   Done



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