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

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


The following commit(s) were added to refs/heads/master by this push:
     new d956cb13af [Bug](point query) Reusable in PointQueryExecutor should  
call init before add to LookupCache (#16489)
d956cb13af is described below

commit d956cb13af0e8da5c4419b3b1c17e4f1d08e26f0
Author: lihangyu <[email protected]>
AuthorDate: Wed Feb 8 16:05:59 2023 +0800

    [Bug](point query) Reusable in PointQueryExecutor should  call init before 
add to LookupCache (#16489)
    
    Otherwise in high concurrent query, _block_pool maybe used before 
Reusable::init done in other threads
---
 be/src/service/point_query_executor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/be/src/service/point_query_executor.cpp 
b/be/src/service/point_query_executor.cpp
index ba17e8fc17..9c70e08061 100644
--- a/be/src/service/point_query_executor.cpp
+++ b/be/src/service/point_query_executor.cpp
@@ -63,6 +63,7 @@ std::unique_ptr<vectorized::Block> Reusable::get_block() {
         return std::make_unique<vectorized::Block>(tuple_desc()->slots(), 4);
     }
     auto block = std::move(_block_pool.back());
+    CHECK(block != nullptr);
     _block_pool.pop_back();
     return block;
 }
@@ -149,9 +150,9 @@ Status PointQueryExecutor::init(const 
PTabletKeyLookupRequest* request,
                 &t_output_exprs));
         _reusable = reusable_ptr;
         if (uuid != 0) {
-            LookupCache::instance().add(uuid, reusable_ptr);
             // could be reused by requests after, pre allocte more blocks
             RETURN_IF_ERROR(reusable_ptr->init(t_desc_tbl, 
t_output_exprs.exprs, 128));
+            LookupCache::instance().add(uuid, reusable_ptr);
         } else {
             RETURN_IF_ERROR(reusable_ptr->init(t_desc_tbl, 
t_output_exprs.exprs, 1));
         }
@@ -164,7 +165,7 @@ Status PointQueryExecutor::init(const 
PTabletKeyLookupRequest* request,
     }
     RETURN_IF_ERROR(_init_keys(request));
     _result_block = _reusable->get_block();
-    DCHECK(_result_block != nullptr);
+    CHECK(_result_block != nullptr);
     return Status::OK();
 }
 


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

Reply via email to