KKcorps commented on code in PR #9132:
URL: https://github.com/apache/pinot/pull/9132#discussion_r933130862


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/PartitionUpsertMetadataManager.java:
##########
@@ -131,10 +144,22 @@ public void addSegment(ImmutableSegment segment) {
       return;
     }
 
-    Preconditions.checkArgument(segment instanceof ImmutableSegmentImpl,
-        "Got unsupported segment implementation: {} for segment: {}, table: 
{}", segment.getClass(), segmentName,
-        _tableNameWithType);
-    addSegment((ImmutableSegmentImpl) segment, new 
ThreadSafeMutableRoaringBitmap(), getRecordInfoIterator(segment));
+    Lock segmentLock = SegmentLocks.getSegmentLock(_tableNameWithType, 
segmentName);
+    segmentLock.lock();

Review Comment:
   Will this work? Don't we already take a lock on same segment in 
`HelixInstanceDataManager.addOrReplaceSegment` in which this method gets called?



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