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

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


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new c180e7cca69 branch-4.1: [fix](memory-tracker) Avoid nested task attach 
in cloud snapshot manager #63189 (#63235)
c180e7cca69 is described below

commit c180e7cca69a3781df3a45ce7468c9a78c76487c
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri May 15 12:25:31 2026 +0800

    branch-4.1: [fix](memory-tracker) Avoid nested task attach in cloud 
snapshot manager #63189 (#63235)
    
    Cherry-picked from #63189
    
    Co-authored-by: Qi Chen <[email protected]>
---
 be/src/cloud/cloud_snapshot_mgr.cpp          | 6 +++---
 be/src/storage/snapshot/snapshot_manager.cpp | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/be/src/cloud/cloud_snapshot_mgr.cpp 
b/be/src/cloud/cloud_snapshot_mgr.cpp
index 6fc1ed04ee8..bd4e3fee767 100644
--- a/be/src/cloud/cloud_snapshot_mgr.cpp
+++ b/be/src/cloud/cloud_snapshot_mgr.cpp
@@ -62,7 +62,7 @@ CloudSnapshotMgr::CloudSnapshotMgr(CloudStorageEngine& 
engine) : _engine(engine)
 Status CloudSnapshotMgr::make_snapshot(int64_t target_tablet_id, 
StorageResource& storage_resource,
                                        std::unordered_map<std::string, 
std::string>& file_mapping,
                                        bool is_restore, const Slice* slice) {
-    SCOPED_ATTACH_TASK(_mem_tracker);
+    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_mem_tracker);
     if (is_restore && slice == nullptr) {
         return Status::Error<INVALID_ARGUMENT>("slice cannot be null in 
restore.");
     }
@@ -106,7 +106,7 @@ Status CloudSnapshotMgr::make_snapshot(int64_t 
target_tablet_id, StorageResource
 }
 
 Status CloudSnapshotMgr::commit_snapshot(int64_t tablet_id) {
-    SCOPED_ATTACH_TASK(_mem_tracker);
+    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_mem_tracker);
     CloudTabletSPtr tablet = 
DORIS_TRY(_engine.tablet_mgr().get_tablet(tablet_id));
     if (tablet == nullptr) {
         return Status::Error<TABLE_NOT_FOUND>("failed to get tablet. 
tablet={}", tablet_id);
@@ -118,7 +118,7 @@ Status CloudSnapshotMgr::commit_snapshot(int64_t tablet_id) 
{
 }
 
 Status CloudSnapshotMgr::release_snapshot(int64_t tablet_id, bool 
is_completed) {
-    SCOPED_ATTACH_TASK(_mem_tracker);
+    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_mem_tracker);
     RETURN_IF_ERROR(_engine.meta_mgr().finish_restore_job(tablet_id, 
is_completed));
     LOG(INFO) << "success to release snapshot. [tablet_id=" << tablet_id << 
"]";
     return Status::OK();
diff --git a/be/src/storage/snapshot/snapshot_manager.cpp 
b/be/src/storage/snapshot/snapshot_manager.cpp
index d57dbc8b50f..f963e1a76d9 100644
--- a/be/src/storage/snapshot/snapshot_manager.cpp
+++ b/be/src/storage/snapshot/snapshot_manager.cpp
@@ -106,7 +106,7 @@ SnapshotManager::~SnapshotManager() = default;
 
 Status SnapshotManager::make_snapshot(const TSnapshotRequest& request, string* 
snapshot_path,
                                       bool* allow_incremental_clone) {
-    SCOPED_ATTACH_TASK(_mem_tracker);
+    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_mem_tracker);
     Status res = Status::OK();
     if (snapshot_path == nullptr) {
         return Status::Error<INVALID_ARGUMENT>("output parameter cannot be 
null");
@@ -152,7 +152,7 @@ Status SnapshotManager::release_snapshot(const string& 
snapshot_path) {
 
     // If the requested snapshot_path is located in the root/snapshot folder, 
it is considered legal and can be deleted.
     // Otherwise, it is considered an illegal request and returns an error 
result.
-    SCOPED_ATTACH_TASK(_mem_tracker);
+    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_mem_tracker);
     auto stores = _engine.get_stores();
     for (auto* store : stores) {
         std::string abs_path;


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

Reply via email to