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


##########
cloud/src/meta-service/meta_service_resource.cpp:
##########
@@ -1680,13 +1800,88 @@ void 
MetaServiceImpl::update_ak_sk(google::protobuf::RpcController* controller,
 
     txn->put(key, val);
     LOG(INFO) << "put instance_id=" << instance_id << " instance_key=" << 
hex(key);
+
+    // Commit root instance first to avoid transaction timeout
     err = txn->commit();
     if (err != TxnErrorCode::TXN_OK) {
         code = cast_as<ErrCategory::COMMIT>(err);
-        msg = fmt::format("failed to commit kv txn, err={}", err);
+        msg = fmt::format("failed to commit root instance kv txn, err={}", 
err);
         LOG(WARNING) << msg;
+        return;
     }
+
     LOG(INFO) << update_record.str();
+    async_notify_refresh_instance(txn_kv_, instance_id, true);
+
+    // Cascade update to derived instances using separate transactions
+    // update_ak_sk is idempotent, so it's safe to use independent transactions
+    std::vector<std::string> cascade_instance_ids;
+    if (find_cascade_instances(txn_kv_.get(), instance_id, 
&cascade_instance_ids) != 0) {

Review Comment:
   add switch to isolate new code from the existing



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