You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/10/30 06:54:23 UTC

[GitHub] [incubator-pinot] chenboat commented on a change in pull request #6213: [Upsert] Preserve the newer added record when 2 records have the same timestamp

chenboat commented on a change in pull request #6213:
URL: https://github.com/apache/incubator-pinot/pull/6213#discussion_r514902109



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/upsert/PartitionUpsertMetadataManager.java
##########
@@ -83,34 +87,34 @@ public ThreadSafeMutableRoaringBitmap addSegment(String segmentName, Iterator<Re
           if (segmentName.equals(currentRecordLocation.getSegmentName())) {
             // The current record location has the same segment name
 
-            if (validDocIds == currentRecordLocation.getValidDocIds()) {
-              // The current record location is pointing to the new segment being loaded
-
-              // Update the record location when getting a newer timestamp
-              if (recordInfo._timestamp > currentRecordLocation.getTimestamp()) {
+            // Update the record location when the new timestamp is greater than or equal to the current timestamp.
+            // There are 2 scenarios:
+            //   1. The current record location is pointing to the new segment being loaded, where we want to update the

Review comment:
       Can you update this line of comments? It is a bit hard to understand. Do you mean:
   "…, where we want to" =>. In this case, we want to update the record location when there is a tie…
   
   also when this is a tie, how to you update the record location? Should it be determined by 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org