You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ya...@apache.org on 2021/04/19 01:27:53 UTC

[incubator-doris] branch master updated: (#5638) stale rowset can't be access after clone finish (#5639)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new b4a4c29  (#5638) stale rowset can't be access after clone finish (#5639)
b4a4c29 is described below

commit b4a4c2965172af2b1753e3f69a2cc325b65282f2
Author: wangbo <50...@qq.com>
AuthorDate: Mon Apr 19 09:27:41 2021 +0800

    (#5638) stale rowset can't be access after clone finish (#5639)
    
    * (#5638) stale rowset can't be access after clone finish
    
    * clear stale rowset after clone
---
 be/src/olap/tablet.cpp    | 6 ++++++
 be/src/olap/tablet_meta.h | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 457d7f0..0c06710 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -193,6 +193,12 @@ OLAPStatus Tablet::revise_tablet_meta(const std::vector<RowsetMetaSharedPtr>& ro
 
     // reconstruct from tablet meta
     _timestamped_version_tracker.construct_versioned_tracker(_tablet_meta->all_rs_metas());
+    // clear stale rowset
+    for (auto& it : _stale_rs_version_map) {
+        StorageEngine::instance()->add_unused_rowset(it.second);
+    }
+    _stale_rs_version_map.clear();
+    _tablet_meta->clear_stale_rowset();
 
     LOG(INFO) << "finish to revise tablet. res=" << res << ", "
               << "table=" << full_name();
diff --git a/be/src/olap/tablet_meta.h b/be/src/olap/tablet_meta.h
index 80279c1..7819280 100644
--- a/be/src/olap/tablet_meta.h
+++ b/be/src/olap/tablet_meta.h
@@ -199,6 +199,11 @@ public:
         _preferred_rowset_type = preferred_rowset_type;
     }
 
+    // used for after tablet cloned to clear stale rowset
+    void clear_stale_rowset() {
+        _stale_rs_metas.clear();
+    }
+
 private:
     OLAPStatus _save_meta(DataDir* data_dir);
 

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