You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2023/03/27 05:35:41 UTC

[doris] branch master updated: [enhance](cooldown) no snapshot or migration action for cooldown tablet (#17658)

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 f03598f214 [enhance](cooldown) no snapshot or migration action for cooldown tablet (#17658)
f03598f214 is described below

commit f03598f2141b4808c10b6cee876c8ca0e505f777
Author: AlexYue <yj...@gmail.com>
AuthorDate: Mon Mar 27 13:35:32 2023 +0800

    [enhance](cooldown) no snapshot or migration action for cooldown tablet (#17658)
---
 be/src/olap/snapshot_manager.cpp                   | 14 +++++++++++++-
 be/src/olap/task/engine_clone_task.cpp             |  5 ++++-
 be/src/olap/task/engine_storage_migration_task.cpp |  7 +++++++
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/snapshot_manager.cpp b/be/src/olap/snapshot_manager.cpp
index 326649b7dd..df65038cf9 100644
--- a/be/src/olap/snapshot_manager.cpp
+++ b/be/src/olap/snapshot_manager.cpp
@@ -399,6 +399,8 @@ Status SnapshotManager::_create_snapshot_files(const TabletSharedPtr& ref_tablet
             if (ref_tablet->tablet_state() == TABLET_SHUTDOWN) {
                 return Status::Aborted("tablet has shutdown");
             }
+            // be would definitely set it as true no matter has missed version or not
+            // but it would take no effets on the following range loop
             if (request.__isset.missing_version) {
                 for (int64_t missed_version : request.missing_version) {
                     Version version = {missed_version, missed_version};
@@ -424,8 +426,18 @@ Status SnapshotManager::_create_snapshot_files(const TabletSharedPtr& ref_tablet
                 }
             }
 
+            // be would definitely set it as true no matter has missed version or not, we could
+            // just check whether the missed version is empty or not
             int64_t version = -1;
-            if (!res.ok() || !request.__isset.missing_version) {
+            if (!res.ok() || request.missing_version.empty()) {
+                if (!request.__isset.missing_version &&
+                    ref_tablet->tablet_meta()->cooldown_meta_id().initialized()) {
+                    LOG(WARNING) << "currently not support backup tablet with cooldowned remote "
+                                    "data. tablet="
+                                 << request.tablet_id;
+                    return Status::NotSupported(
+                            "currently not support backup tablet with cooldowned remote data");
+                }
                 /// not all missing versions are found, fall back to full snapshot.
                 res = Status::OK();         // reset res
                 consistent_rowsets.clear(); // reset vector
diff --git a/be/src/olap/task/engine_clone_task.cpp b/be/src/olap/task/engine_clone_task.cpp
index 7ef38f450b..1b4156f238 100644
--- a/be/src/olap/task/engine_clone_task.cpp
+++ b/be/src/olap/task/engine_clone_task.cpp
@@ -311,7 +311,10 @@ Status EngineCloneTask::_make_snapshot(const std::string& ip, int port, TTableId
     request.__set_version(_clone_req.committed_version);
     // TODO: missing version composed of singleton delta.
     // if not, this place should be rewrote.
-    request.__isset.missing_version = (!missed_versions.empty());
+    // we make every TSnapshotRequest sent from be with __isset.missing_version = true
+    // then if one be received one req with __isset.missing_version = false it means
+    // this req is sent from FE(FE would never set this field)
+    request.__isset.missing_version = true;
     for (auto& version : missed_versions) {
         request.missing_version.push_back(version.first);
     }
diff --git a/be/src/olap/task/engine_storage_migration_task.cpp b/be/src/olap/task/engine_storage_migration_task.cpp
index e0d7ca4378..43c6b4263d 100644
--- a/be/src/olap/task/engine_storage_migration_task.cpp
+++ b/be/src/olap/task/engine_storage_migration_task.cpp
@@ -41,6 +41,13 @@ Status EngineStorageMigrationTask::execute() {
 Status EngineStorageMigrationTask::_get_versions(int32_t start_version, int32_t* end_version,
                                                  std::vector<RowsetSharedPtr>* consistent_rowsets) {
     std::shared_lock rdlock(_tablet->get_header_lock());
+    // check if tablet is in cooldown, we don't support migration in this case
+    if (_tablet->tablet_meta()->cooldown_meta_id().initialized()) {
+        LOG(WARNING) << "currently not support migrate tablet with cooldowned remote data. tablet="
+                     << _tablet->tablet_id();
+        return Status::NotSupported(
+                "currently not support migrate tablet with cooldowned remote data");
+    }
     const RowsetSharedPtr last_version = _tablet->rowset_with_max_version();
     if (last_version == nullptr) {
         return Status::InternalError("failed to get rowset with max version, tablet={}",


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