This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new cfa4f6701cb branch-3.0:[fix](mow) fix potential mem leak for 
DeleteBitmap::get_agg (#52718, #52756) (#52931)
cfa4f6701cb is described below

commit cfa4f6701cb9398854ee0a87cc1d0e3aa07b0696
Author: zhannngchen <[email protected]>
AuthorDate: Wed Jul 9 11:38:02 2025 +0800

    branch-3.0:[fix](mow) fix potential mem leak for DeleteBitmap::get_agg 
(#52718, #52756) (#52931)
    
    cherry-pick #52718, #52756
---
 be/src/olap/tablet_meta.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/be/src/olap/tablet_meta.cpp b/be/src/olap/tablet_meta.cpp
index d2fc0945514..4a86bbbb013 100644
--- a/be/src/olap/tablet_meta.cpp
+++ b/be/src/olap/tablet_meta.cpp
@@ -1472,13 +1472,15 @@ std::shared_ptr<roaring::Roaring> 
DeleteBitmap::get_agg(const BitmapKey& bmk) co
                 val->bitmap |= reinterpret_cast<DeleteBitmapAggCache::Value*>(
                                        
DeleteBitmapAggCache::instance()->value(handle2))
                                        ->bitmap;
-                DeleteBitmapAggCache::instance()->release(handle2);
                 VLOG_DEBUG << "get agg cache version=" << start_version
                            << " for tablet=" << _tablet_id
                            << ", rowset=" << std::get<0>(bmk).to_string()
                            << ", segment=" << std::get<1>(bmk);
                 start_version += 1;
             }
+            if (handle2 != nullptr) {
+                DeleteBitmapAggCache::instance()->release(handle2);
+            }
         }
         {
             std::shared_lock l(lock);


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

Reply via email to