diff --git a/be/src/olap/snapshot_manager.cpp b/be/src/olap/snapshot_manager.cpp index 0fa4e59185..370161597a 100644 --- a/be/src/olap/snapshot_manager.cpp +++ b/be/src/olap/snapshot_manager.cpp @@ -80,7 +80,7 @@ SnapshotManager* SnapshotManager::instance() { Status SnapshotManager::make_snapshot(const TSnapshotRequest& request, string* snapshot_path, bool* allow_incremental_clone) { - SCOPED_CONSUME_MEM_TRACKER(_mem_tracker); + SCOPED_ATTACH_TASK(_mem_tracker); Status res = Status::OK(); if (snapshot_path == nullptr) { return Status::Error("output parameter cannot be null"); @@ -106,7 +106,7 @@ Status SnapshotManager::make_snapshot(const TSnapshotRequest& request, string* s 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_CONSUME_MEM_TRACKER(_mem_tracker); + SCOPED_ATTACH_TASK(_mem_tracker); auto stores = StorageEngine::instance()->get_stores(); for (auto store : stores) { std::string abs_path; @@ -127,7 +127,7 @@ Status SnapshotManager::release_snapshot(const string& snapshot_path) { Result> SnapshotManager::convert_rowset_ids( const std::string& clone_dir, int64_t tablet_id, int64_t replica_id, int64_t partition_id, int32_t schema_hash) { - SCOPED_CONSUME_MEM_TRACKER(_mem_tracker); + SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_mem_tracker); std::vector guards; // check clone dir existed bool exists = true; diff --git a/be/src/olap/snapshot_manager.h b/be/src/olap/snapshot_manager.h index 20b11ce7b3..4f06c3c87c 100644 --- a/be/src/olap/snapshot_manager.h +++ b/be/src/olap/snapshot_manager.h @@ -29,7 +29,7 @@ #include "olap/rowset/rowset.h" #include "olap/tablet.h" #include "olap/tablet_schema.h" -#include "runtime/memory/mem_tracker.h" +#include "runtime/memory/mem_tracker_limiter.h" namespace doris { class RowsetMetaPB; @@ -63,7 +63,7 @@ public: private: SnapshotManager() : _snapshot_base_id(0) { - _mem_tracker = std::make_shared("SnapshotManager"); + _mem_tracker = MemTrackerLimiter::create_shared(MemTrackerLimiter::Type::OTHER, "SnapshotManager"); } Status _calc_snapshot_id_path(const TabletSharedPtr& tablet, int64_t timeout_s, @@ -97,7 +97,7 @@ private: std::mutex _snapshot_mutex; uint64_t _snapshot_base_id; - std::shared_ptr _mem_tracker; + std::shared_ptr _mem_tracker; }; // SnapshotManager } // namespace doris