gavinchou commented on code in PR #33269:
URL: https://github.com/apache/doris/pull/33269#discussion_r1553219809


##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -539,11 +539,24 @@ void 
MetaServiceImpl::create_tablets(::google::protobuf::RpcController* controll
             return;
         }
 
-        std::shared_ptr<Transaction> txn(txn0.release());
-        auto [c0, m0] = resource_mgr_->get_instance(txn, instance_id, 
&instance);
-        if (c0 != TxnErrorCode::TXN_OK) {
+        InstanceKeyInfo key_info {instance_id};
+        std::string key;
+        std::string val;
+        instance_key(key_info, &key);
+        
+        err = txn0->get(key, &val);
+        LOG(INFO) << "get instance_key=" << hex(key);
+
+        if (err != TxnErrorCode::TXN_OK) {
             code = cast_as<ErrCategory::READ>(err);
-            msg = fmt::format("failed to get instance, info={}", m0);
+            ss << "failed to get instance, instance_id=" << instance_id << " 
err=" << err;
+            msg = ss.str();
+            return;
+        }
+
+        if (!instance.ParseFromString(val)) {
+            code = MetaServiceCode::PROTOBUF_PARSE_ERR;
+            msg = "failed to parse InstanceInfoPB";

Review Comment:
   also print 
   ss << err



##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -539,11 +539,24 @@ void 
MetaServiceImpl::create_tablets(::google::protobuf::RpcController* controll
             return;
         }
 
-        std::shared_ptr<Transaction> txn(txn0.release());
-        auto [c0, m0] = resource_mgr_->get_instance(txn, instance_id, 
&instance);
-        if (c0 != TxnErrorCode::TXN_OK) {
+        InstanceKeyInfo key_info {instance_id};
+        std::string key;

Review Comment:
   use the form 
   auto key = instanceke(info);



-- 
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