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


##########
cloud/src/meta-service/meta_service_helper.h:
##########
@@ -162,6 +165,86 @@ inline std::string hide_ak(std::string debug_string) {
     return debug_string;
 }
 
+inline void clear_node_cloud_unique_ids(ClusterPB& cluster) {
+    for (auto& node : *cluster.mutable_nodes()) {
+        node.clear_cloud_unique_id();
+    }
+}
+
+// Keep identifiers used to correlate RPC logs without dumping the message.
+template <class Message>
+std::string rpc_log_ids(const Message& message) {
+    std::ostringstream log;
+    if constexpr (requires { message.has_instance_id(); }) {
+        if (message.has_instance_id()) {
+            log << " instance_id=" << message.instance_id();
+        }
+    }
+    if constexpr (requires { message.has_db_id(); }) {
+        if (message.has_db_id()) {
+            log << " db_id=" << message.db_id();
+        }
+    }
+    if constexpr (requires { message.has_table_id(); }) {
+        if (message.has_table_id()) {
+            log << " table_id=" << message.table_id();
+        }
+    }
+    if constexpr (requires { message.has_tablet_id(); }) {
+        if (message.has_tablet_id()) {
+            log << " tablet_id=" << message.tablet_id();
+        }
+    }
+    if constexpr (requires { message.has_txn_id(); }) {
+        if (message.has_txn_id()) {
+            log << " txn_id=" << message.txn_id();
+        }
+    }
+    if constexpr (requires { message.has_cluster_id(); }) {
+        if (message.has_cluster_id()) {
+            log << " cluster_id=" << message.cluster_id();
+        }
+    }
+    if constexpr (requires { message.has_job_id(); }) {
+        if (message.has_job_id()) {
+            log << " job_id=" << message.job_id();
+        }
+    }
+    if constexpr (requires { message.has_snapshot_id(); }) {
+        if (message.has_snapshot_id()) {
+            log << " snapshot_id=" << message.snapshot_id();
+        }
+    }
+    if constexpr (requires { message.has_stage_id(); }) {
+        if (message.has_stage_id()) {
+            log << " stage_id=" << message.stage_id();
+        }
+    }
+    return log.str();
+}
+
+template <class Request>
+inline constexpr bool is_credential_update_request =
+        std::is_same_v<Request, UpdateAkSkRequest> || std::is_same_v<Request, 
AlterRamUserRequest>;
+
+template <class Request>
+std::string read_rpc_log_ids(const Request& req) {

Review Comment:
   what is the difference to rpc_log_id



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