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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/ConcurrentMapPartitionUpsertMetadataManager.java:
##########
@@ -264,18 +279,22 @@ protected boolean doAddRecord(MutableSegment segment, 
RecordInfo recordInfo) {
           if (currentRecordLocation != null) {
             // Existing primary key
 
+            IndexSegment currentSegment = currentRecordLocation.getSegment();
             // Update the record location when the new comparison value is 
greater than or equal to the current value.
             // Update the record location when there is a tie to keep the 
newer record.
             if 
(newComparisonValue.compareTo(currentRecordLocation.getComparisonValue()) >= 0) 
{
-              IndexSegment currentSegment = currentRecordLocation.getSegment();
               int currentDocId = currentRecordLocation.getDocId();
               if (segment == currentSegment) {

Review Comment:
   We need to do it for both if and else conditions, so it makes more sense to 
have the segment retrieved first rather than doing it condition wise.



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