MACCCTK commented on code in PR #55061:
URL: https://github.com/apache/doris/pull/55061#discussion_r2287455226


##########
be/src/http/action/meta_action.cpp:
##########
@@ -67,18 +67,36 @@ Status MetaAction::_handle_header(HttpRequest* req, 
std::string* json_meta) {
         return Status::InternalError("convert failed, {}", e.what());
     }
 
-    auto tablet = DORIS_TRY(ExecEnv::get_tablet(tablet_id));
     std::string operation = req->param(OP);
-    if (operation == HEADER) {
-        TabletMeta tablet_meta;
-        tablet->generate_tablet_meta_copy(tablet_meta);
-        json2pb::Pb2JsonOptions json_options;
-        json_options.pretty_json = true;
-        json_options.bytes_to_base64 = enable_byte_to_base64;
-        tablet_meta.to_json(json_meta, json_options);
-        return Status::OK();
-    } else if (operation == DATA_SIZE) {
-        if (!config::is_cloud_mode()) {
+    if (config::is_cloud_mode()) {
+        TabletMetaSharedPtr tablet_meta;
+        if (operation == HEADER) {
+            // option 1: get meta data directly using cloud_meta_mgr
+            cloud::CloudMetaMgr& cloud_meta_mgr = 
_exec_env->storage_engine()->meta_mgr();
+            Status st = cloud_meta_mgr->get_tablet_meta(tablet_id, 
&tablet_meta);
+            if (!st.ok()) {
+                return Status::InternalError("tablet meta not found, err: {}", 
st.to_string());
+            }
+            json2pb::Pb2JsonOptions json_options;
+            json_options.pretty_json = true;
+            json_options.bytes_to_base64 = enable_byte_to_base64;
+            tablet_meta.to_json(json_meta, json_options);
+            return Status::OK();
+
+            // option 2: get meta data using ExecEnv::get_tablet
+            // same code to the local mode
+        }

Review Comment:
   I have considered this point before. Currently, I have chosen not to 
implement this method since I am not entirely sure if my understanding of the 
compute-storage decoupled architecture is accurate. In local mode, data_size 
seems to be used to reflect the distribution of the tablet across the current 
BE node and other BE nodes. However, in cloud mode, BE nodes are no longer 
responsible for storage functions. So, I wonder is there still a need to 
maintain the distribution info of the tablet among BE nodes?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to