tarun11Mavani commented on code in PR #16034:
URL: https://github.com/apache/pinot/pull/16034#discussion_r2137305161


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java:
##########
@@ -826,13 +847,28 @@ public void 
downloadAndReplaceConsumingSegment(SegmentZKMetadata zkMetadata)
   /**
    * Replaces the CONSUMING segment with the one sealed locally.
    */
+  @Deprecated

Review Comment:
   Marking this as @Deprecated for now. This is not used anywhere.



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -1146,4 +1148,21 @@ public Set<String> getNewlyAddedSegments() {
     }
     return Collections.emptySet();
   }
+
+  /**
+   * Gets the authoritative creation time for upsert comparison.
+   * Uses ZK creation time if available for consistency across replicas, 
otherwise falls back to local creation time.
+   */
+  protected long getAuthoritativeCreationTime(IndexSegment segment) {
+    SegmentMetadata segmentMetadata = segment.getSegmentMetadata();
+    if (segmentMetadata instanceof SegmentMetadataImpl) {

Review Comment:
   Yes. That and to avoid running into InvalidClassException if we add any more 
implementation of `SegmentMetadata`. 
   Added an early exit for MutubleSegment. For MutableSegment, we have 
IndexCreationTime = consuming segment creation time from controller. 



-- 
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: commits-unsubscr...@pinot.apache.org

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


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

Reply via email to