You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/11/18 11:22:50 UTC

[GitHub] [druid] clintropolis commented on a diff in pull request #13386: Fixes reindexing bug with filter on long column

clintropolis commented on code in PR #13386:
URL: https://github.com/apache/druid/pull/13386#discussion_r1026320820


##########
processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarLongsSupplier.java:
##########
@@ -204,7 +204,10 @@ protected void loadBuffer(int bufferNum)
     public void close()
     {
       if (holder != null) {
+        currBufferNum = -1;
         holder.close();
+        holder = null;
+        buffer = null;

Review Comment:
   nit: I guess `currBufferNum` is the only thing that truly matters here, but just to be consistent maybe we should also null out `longBuffer` since we are doing that for everything else.
   
   Additionally, while I am not aware of anywhere which is double closing any float or double columns, they do suffer from the same flaw of not resetting `currBufferNum` when closed, and so could also read from a buffer that has been returned to the pool if that happened,
   * https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarFloatsSupplier.java#L183
   * https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/data/BlockLayoutColumnarDoublesSupplier.java#L183
   



-- 
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-unsubscribe@druid.apache.org

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


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