github-actions[bot] commented on code in PR #69732:
URL: https://github.com/apache/doris/pull/69732#discussion_r4398764670


##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -138,6 +138,20 @@ std::string get_instance_id(const 
std::shared_ptr<ResourceManager>& rc_mgr,
                 LOG(WARNING) << msg << ", cloud_unique_id=" << cloud_unique_id;
                 return "";
             }
+            // Anyone knowing the instance_id can build a degraded format 
cloud_unique_id, so it
+            // is only trusted when it is a registered node of that instance.
+            bool registered = false;
+            for (const auto& cluster : instance.clusters()) {
+                for (const auto& node : cluster.nodes()) {
+                    registered |= node.cloud_unique_id() == cloud_unique_id;
+                }
+            }
+            if (!registered) {

Review Comment:
   [P2] Preserve retryable KV errors during node membership checks
   
   For a registered node missing from this MS's cache (e.g. just added through 
another MS), `get_instance` can return `TXN_TOO_OLD` or 
`TXN_RETRYABLE_NOT_COMMITTED` and leave `instance` empty. Those errors pass the 
earlier `TXN_KEY_NOT_FOUND` check, so this new scan returns an empty ID as 
though the node were unregistered. Handlers such as `prepare_rowset` then 
return `INVALID_ARGUMENT`, which neither `call_impl` nor the BE `retry_rpc` 
retries, aborting a valid operation on a transient storage failure. Preserve 
the lookup error and route retryable failures through the proxy retry path; 
only conclude that membership is absent after a successful instance read.



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