Skip to content

Commit

Permalink
fix mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
GehaFearless committed Dec 4, 2023
1 parent 8c93386 commit de96af6
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/client/replication_ddl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions src/failure_detector/failure_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ std::string failure_detector::get_allow_list(const std::vector<std::string> &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;
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/failure_detector/failure_detector_multimaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[{}({})], "
Expand Down
2 changes: 1 addition & 1 deletion src/failure_detector/test/failure_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class test_worker : public service_app, public serverlet<test_worker>
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);
Expand Down
6 changes: 3 additions & 3 deletions src/meta/meta_server_failure_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -286,8 +286,8 @@ void meta_server_failure_detector::on_ping(const fd::beacon_msg &beacon,
rpc_replier<fd::beacon_ack> &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(
Expand Down
4 changes: 2 additions & 2 deletions src/meta/server_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/meta/test/misc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/replica/replica_learn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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 = {}",
Expand Down
2 changes: 1 addition & 1 deletion src/replica/split/replica_split_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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={}",
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/rpc/rpc_host_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
2 changes: 1 addition & 1 deletion src/shell/commands/recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++ << "]: "
Expand Down

0 comments on commit de96af6

Please sign in to comment.