loquisgon commented on a change in pull request #11123:
URL: https://github.com/apache/druid/pull/11123#discussion_r616078447



##########
File path: 
server/src/main/java/org/apache/druid/segment/realtime/appenderator/AppenderatorImpl.java
##########
@@ -849,13 +851,24 @@ private DataSegment mergeAndPush(
           // semantics.
           () -> dataSegmentPusher.push(
               mergedFile,
-              
sink.getSegment().withDimensions(IndexMerger.getMergedDimensionsFromQueryableIndexes(indexes,
 schema.getDimensionsSpec())),
+              sink.getSegment()
+                  
.withDimensions(IndexMerger.getMergedDimensionsFromQueryableIndexes(
+                      indexes,
+                      schema.getDimensionsSpec()
+                  )),
               useUniquePath
           ),
           exception -> exception instanceof Exception,
           5
       );
 
+      // Drop the queriable indexes  behind the hydrants... they are not 
needed anymore and their
+      // mapped file references
+      // can generate OOMs during merge if enough of them are held back...
+      for (FireHydrant fireHydrant : sink) {
+        fireHydrant.swapSegment(null);
+      }

Review comment:
       It turns out that queries can still happen for realtime after hydrants 
are merged... I just added code to deal with this case. For realtime ingestion, 
memory mappings must remain after merge.




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to