findingrish commented on code in PR #13967:
URL: https://github.com/apache/druid/pull/13967#discussion_r1694232150


##########
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataManager.java:
##########
@@ -936,10 +974,49 @@ public DataSegment map(int index, ResultSet r, 
StatementContext ctx) throws SQLE
     } else {
       log.info("Polled and found %,d segments in the database", 
segments.size());
     }
-    dataSourcesSnapshot = DataSourcesSnapshot.fromUsedSegments(
-        Iterables.filter(segments, Objects::nonNull), // Filter corrupted 
entries (see above in this method).
-        dataSourceProperties
-    );
+
+    handedOffSegments.clear();

Review Comment:
   Yes, there was a race. I have fixed it by making the variable (now renamed 
to `loadedSegments`) as AtomicReference. 



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