xiangfu0 commented on code in PR #18320:
URL: https://github.com/apache/pinot/pull/18320#discussion_r3150988602


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/store/FilePerIndexDirectory.java:
##########
@@ -99,8 +100,16 @@ public void close()
 
   @Override
   public void removeIndex(String columnName, IndexType<?, ?, ?> indexType) {
-    // TODO: this leaks the removed data buffer (it's not going to be freed in 
close() method)
-    _indexBuffers.remove(new IndexKey(columnName, indexType));
+    IndexKey key = new IndexKey(columnName, indexType);
+    PinotDataBuffer removed = _indexBuffers.remove(key);
+    if (removed != null) {
+      try {
+        removed.close();
+      } catch (IOException e) {
+        throw new UncheckedIOException(

Review Comment:
   shall we just log error and continue?



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