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

yiguolei 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 645f6d4a9fa [Fix](Top-N opt) evicting quering rowsets in prior to 
correct use_count (#102) (#30904)
645f6d4a9fa is described below

commit 645f6d4a9fa5056fc0e51211d85c31b956bb88c6
Author: lihangyu <15605149...@163.com>
AuthorDate: Thu Feb 8 22:30:45 2024 +0800

    [Fix](Top-N opt) evicting quering rowsets in prior to correct use_count 
(#102) (#30904)
    
    This addresses the scenario where a rowset cannot be removed.
---
 be/src/exec/rowid_fetcher.cpp  | 2 +-
 be/src/olap/storage_engine.cpp | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/be/src/exec/rowid_fetcher.cpp b/be/src/exec/rowid_fetcher.cpp
index d527a3ac055..6a7e21d81cc 100644
--- a/be/src/exec/rowid_fetcher.cpp
+++ b/be/src/exec/rowid_fetcher.cpp
@@ -231,7 +231,7 @@ Status RowIDFetcher::fetch(const vectorized::ColumnPtr& 
column_row_ids,
     std::vector<PRowLocation> rows_locs;
     rows_locs.reserve(rows_locs.size());
     RETURN_IF_ERROR(_merge_rpc_results(mget_req, resps, cntls, res_block, 
&rows_locs));
-    if (rows_locs.size() != res_block->rows()) {
+    if (rows_locs.size() != res_block->rows() || rows_locs.size() != 
column_row_ids->size()) {
         return Status::InternalError("Miss matched return row loc count {}, 
expected {}, input {}",
                                      rows_locs.size(), res_block->rows(), 
column_row_ids->size());
     }
diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp
index d93308835fb..f539902d740 100644
--- a/be/src/olap/storage_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -1079,10 +1079,11 @@ void StorageEngine::start_delete_unused_rowset() {
         for (auto it = _unused_rowsets.begin(); it != _unused_rowsets.end();) {
             uint64_t now = UnixSeconds();
             auto&& rs = it->second;
-            if (rs.use_count() == 1 && rs->need_delete_file() &&
+            if (now > rs->delayed_expired_timestamp()) {
                 // We delay the GC time of this rowset since it's maybe still 
needed, see #20732
-                now > rs->delayed_expired_timestamp()) {
                 evict_querying_rowset(it->second->rowset_id());
+            }
+            if (rs.use_count() == 1 && rs->need_delete_file()) {
                 // remote rowset data will be reclaimed by 
`remove_unused_remote_files`
                 if (rs->is_local()) {
                     unused_rowsets_copy.push_back(std::move(rs));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to