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


##########
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) {
+        LOG(WARNING) << "failed to find derived instances for cascade update, 
instance_id="
+                     << instance_id << ", root instance already updated 
successfully";
+        return;
+    }
+
+    LOG(INFO) << "Found " << cascade_instance_ids.size() << " derived 
instances to cascade update";

Review Comment:
   also print all the instance ids found



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