From de96af680444b08d73d5110e62f8c3558c0c4ce5 Mon Sep 17 00:00:00 2001 From: liguohao <948193394@qq.com> Date: Mon, 4 Dec 2023 19:13:03 +0800 Subject: [PATCH] fix mac build --- src/client/replication_ddl_client.cpp | 2 +- src/failure_detector/failure_detector.cpp | 8 ++++---- src/failure_detector/failure_detector_multimaster.cpp | 4 ++-- src/failure_detector/test/failure_detector.cpp | 2 +- src/meta/meta_server_failure_detector.cpp | 6 +++--- src/meta/server_state.cpp | 4 ++-- src/meta/test/misc/misc.cpp | 8 ++++---- src/replica/replica_learn.cpp | 4 ++-- src/replica/split/replica_split_manager.cpp | 2 +- src/runtime/rpc/rpc_host_port.h | 2 +- src/shell/commands/recovery.cpp | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/client/replication_ddl_client.cpp b/src/client/replication_ddl_client.cpp index 59cad6b47c..14bf35d821 100644 --- a/src/client/replication_ddl_client.cpp +++ b/src/client/replication_ddl_client.cpp @@ -527,7 +527,7 @@ dsn::error_code replication_ddl_client::list_nodes( for (dsn::replication::node_info &n : resp.infos) { host_port hp; - HOST_PORT(n, address, hp); + GET_HOST_PORT(n, address, hp); nodes[hp] = n.status; } diff --git a/src/failure_detector/failure_detector.cpp b/src/failure_detector/failure_detector.cpp index 778b401a50..8bc76d3009 100644 --- a/src/failure_detector/failure_detector.cpp +++ b/src/failure_detector/failure_detector.cpp @@ -356,8 +356,8 @@ std::string failure_detector::get_allow_list(const std::vector &arg void failure_detector::on_ping_internal(const beacon_msg &beacon, /*out*/ beacon_ack &ack) { host_port hp_from_addr, hp_to_addr; - HOST_PORT(beacon, from_addr, hp_from_addr); - HOST_PORT(beacon, to_addr, hp_to_addr); + GET_HOST_PORT(beacon, from_addr, hp_from_addr); + GET_HOST_PORT(beacon, to_addr, hp_to_addr); ack.time = beacon.time; ack.this_node = beacon.to_addr; @@ -424,8 +424,8 @@ bool failure_detector::end_ping_internal(::dsn::error_code err, const beacon_ack * the caller of the end_ping_internal should lock necessarily!!! */ host_port hp_this_node, hp_primary_node; - HOST_PORT(ack, this_node, hp_this_node); - HOST_PORT(ack, primary_node, hp_primary_node); + GET_HOST_PORT(ack, this_node, hp_this_node); + GET_HOST_PORT(ack, primary_node, hp_primary_node); uint64_t beacon_send_time = ack.time; diff --git a/src/failure_detector/failure_detector_multimaster.cpp b/src/failure_detector/failure_detector_multimaster.cpp index aa9928e540..88c506ebfa 100644 --- a/src/failure_detector/failure_detector_multimaster.cpp +++ b/src/failure_detector/failure_detector_multimaster.cpp @@ -73,8 +73,8 @@ void slave_failure_detector_with_multimaster::end_ping(::dsn::error_code err, void *) { host_port hp_this_node, hp_primary_node; - HOST_PORT(ack, this_node, hp_this_node); - HOST_PORT(ack, primary_node, hp_primary_node); + GET_HOST_PORT(ack, this_node, hp_this_node); + GET_HOST_PORT(ack, primary_node, hp_primary_node); LOG_INFO( "end ping result, error[{}], time[{}], ack.this_node[{}({})], ack.primary_node[{}({})], " diff --git a/src/failure_detector/test/failure_detector.cpp b/src/failure_detector/test/failure_detector.cpp index b772a76a83..9a461b16b1 100644 --- a/src/failure_detector/test/failure_detector.cpp +++ b/src/failure_detector/test/failure_detector.cpp @@ -214,7 +214,7 @@ class test_worker : public service_app, public serverlet request.is_register ? "reg" : "unreg"); host_port master; - HOST_PORT(request, master, master); + GET_HOST_PORT(request, master, master); if (request.is_register) _worker_fd->register_master(master); diff --git a/src/meta/meta_server_failure_detector.cpp b/src/meta/meta_server_failure_detector.cpp index dc3813f85d..0f4a600e2d 100644 --- a/src/meta/meta_server_failure_detector.cpp +++ b/src/meta/meta_server_failure_detector.cpp @@ -228,7 +228,7 @@ bool meta_server_failure_detector::update_stability_stat(const fd::beacon_msg &b zauto_lock l(_map_lock); host_port hp_from_addr; - HOST_PORT(beacon, from_addr, hp_from_addr); + GET_HOST_PORT(beacon, from_addr, hp_from_addr); auto iter = _stablity.find(hp_from_addr); if (iter == _stablity.end()) { @@ -286,8 +286,8 @@ void meta_server_failure_detector::on_ping(const fd::beacon_msg &beacon, rpc_replier &reply) { host_port hp_from_addr, hp_to_addr; - HOST_PORT(beacon, from_addr, hp_from_addr); - HOST_PORT(beacon, to_addr, hp_to_addr); + GET_HOST_PORT(beacon, from_addr, hp_from_addr); + GET_HOST_PORT(beacon, to_addr, hp_to_addr); if (beacon.__isset.start_time && !update_stability_stat(beacon)) { LOG_WARNING( diff --git a/src/meta/server_state.cpp b/src/meta/server_state.cpp index 19bb4b7ef9..7d83550be1 100644 --- a/src/meta/server_state.cpp +++ b/src/meta/server_state.cpp @@ -842,7 +842,7 @@ void server_state::on_config_sync(configuration_query_by_node_rpc rpc) response.__isset.gc_replicas = false; host_port hp_node; - HOST_PORT(request, node, hp_node); + GET_HOST_PORT(request, node, hp_node); LOG_INFO("got config sync request from {}({}), stored_replicas_count({})", hp_node, @@ -1478,7 +1478,7 @@ void server_state::list_apps(const configuration_list_apps_request &request, void server_state::send_proposal(host_port target, const configuration_update_request &proposal) { host_port hp; - HOST_PORT(proposal, node, hp); + GET_HOST_PORT(proposal, node, hp); LOG_INFO("send proposal {} for gpid({}), ballot = {}, target = {}, node = {}({})", ::dsn::enum_to_string(proposal.type), proposal.config.pid, diff --git a/src/meta/test/misc/misc.cpp b/src/meta/test/misc/misc.cpp index 5cd70375ac..b5ecbf32cd 100644 --- a/src/meta/test/misc/misc.cpp +++ b/src/meta/test/misc/misc.cpp @@ -243,8 +243,8 @@ void track_disk_info_check_and_apply(const dsn::replication::configuration_propo CHECK_NOTNULL(cc, ""); dsn::host_port hp_target, hp_node; - HOST_PORT(act, target, hp_target); - HOST_PORT(act, node, hp_node); + GET_HOST_PORT(act, target, hp_target); + GET_HOST_PORT(act, node, hp_node); fs_manager *target_manager = get_fs_manager(manager, hp_target); CHECK_NOTNULL(target_manager, ""); @@ -304,8 +304,8 @@ void proposal_action_check_and_apply(const configuration_proposal_action &act, } dsn::host_port hp_target, hp_node; - HOST_PORT(act, target, hp_target); - HOST_PORT(act, node, hp_node); + GET_HOST_PORT(act, target, hp_target); + GET_HOST_PORT(act, node, hp_node); switch (act.type) { case config_type::CT_ASSIGN_PRIMARY: diff --git a/src/replica/replica_learn.cpp b/src/replica/replica_learn.cpp index 58e450e1ea..5445a125ec 100644 --- a/src/replica/replica_learn.cpp +++ b/src/replica/replica_learn.cpp @@ -377,7 +377,7 @@ void replica::on_learn(dsn::message_ex *msg, const learn_request &request) _primary_states.get_replica_config(partition_status::PS_POTENTIAL_SECONDARY, response.config); host_port hp_learner; - HOST_PORT(request, learner, hp_learner); + GET_HOST_PORT(request, learner, hp_learner); auto it = _primary_states.learners.find(hp_learner); if (it == _primary_states.learners.end()) { @@ -1375,7 +1375,7 @@ void replica::on_learn_completion_notification(const group_check_response &repor _checker.only_one_thread_access(); host_port hp; - HOST_PORT(report, node, hp); + GET_HOST_PORT(report, node, hp); LOG_INFO_PREFIX( "on_learn_completion_notification[{:#018x}]: learner = {}({}), learning_status = {}", diff --git a/src/replica/split/replica_split_manager.cpp b/src/replica/split/replica_split_manager.cpp index c277d516e7..e26d8b68e1 100644 --- a/src/replica/split/replica_split_manager.cpp +++ b/src/replica/split/replica_split_manager.cpp @@ -652,7 +652,7 @@ void replica_split_manager::parent_handle_child_catch_up( } host_port hp; - HOST_PORT(request, child_address, hp); + GET_HOST_PORT(request, child_address, hp); response.err = ERR_OK; LOG_INFO_PREFIX("receive catch_up request from {}@{}({}), current ballot={}", diff --git a/src/runtime/rpc/rpc_host_port.h b/src/runtime/rpc/rpc_host_port.h index edd5bd2c45..b5a301ddaa 100644 --- a/src/runtime/rpc/rpc_host_port.h +++ b/src/runtime/rpc/rpc_host_port.h @@ -41,7 +41,7 @@ class TProtocol; } // namespace thrift } // namespace apache -#define HOST_PORT(obj, field, target) \ +#define GET_HOST_PORT(obj, field, target) \ do { \ if (obj.__isset.hp_##field) { \ target = obj.hp_##field; \ diff --git a/src/shell/commands/recovery.cpp b/src/shell/commands/recovery.cpp index 73f3a5742c..f76f1a2e0a 100644 --- a/src/shell/commands/recovery.cpp +++ b/src/shell/commands/recovery.cpp @@ -295,7 +295,7 @@ bool ddd_diagnose(command_executor *e, shell_context *sc, arguments args) int j = 0; for (const ddd_node_info &n : pinfo.dropped) { dsn::host_port hp; - HOST_PORT(n, node, hp); + GET_HOST_PORT(n, node, hp); char time_buf[30] = {0}; ::dsn::utils::time_ms_to_string(n.drop_time_ms, time_buf); out << " dropped[" << j++ << "]: "