Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
GehaFearless committed Nov 28, 2023
1 parent a1fd9e0 commit dd36427
Show file tree
Hide file tree
Showing 5 changed files with 25 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);
HOST_PORT(n, address, hp);
nodes[hp] = n.status;
}

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);
HOST_PORT(request, master, master);

if (request.is_register)
_worker_fd->register_master(master);
Expand Down
27 changes: 15 additions & 12 deletions src/replica/duplication/replica_follower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,21 @@ void replica_follower::async_duplicate_checkpoint_from_master_replica()
dsn::message_ex *msg = dsn::message_ex::create_request(
RPC_CM_QUERY_PARTITION_CONFIG_BY_INDEX, 0, get_gpid().thread_hash());
dsn::marshall(msg, meta_config_request);
rpc::call(_replica->get_dns_resolver()->resolve_address(meta_servers), msg, &_tracker, [&](error_code err, query_cfg_response &&resp) mutable {
FAIL_POINT_INJECT_F("duplicate_checkpoint_ok", [&](absl::string_view s) -> void {
_tracker.set_tasks_success();
return;
});

FAIL_POINT_INJECT_F("duplicate_checkpoint_failed",
[&](absl::string_view s) -> void { return; });
if (update_master_replica_config(err, std::move(resp)) == ERR_OK) {
copy_master_replica_checkpoint();
}
});
rpc::call(_replica->get_dns_resolver()->resolve_address(meta_servers),
msg,
&_tracker,
[&](error_code err, query_cfg_response &&resp) mutable {
FAIL_POINT_INJECT_F("duplicate_checkpoint_ok", [&](absl::string_view s) -> void {
_tracker.set_tasks_success();
return;
});

FAIL_POINT_INJECT_F("duplicate_checkpoint_failed",
[&](absl::string_view s) -> void { return; });
if (update_master_replica_config(err, std::move(resp)) == ERR_OK) {
copy_master_replica_checkpoint();
}
});
}

// ThreadPool: THREAD_POOL_DEFAULT
Expand Down
14 changes: 7 additions & 7 deletions src/runtime/rpc/rpc_host_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class TProtocol;
} // namespace thrift
} // namespace apache

#define HOST_PORT(obj, field, target) \
do { \
if (obj.__isset.hp_##field) { \
target = obj.hp_##field; \
} else { \
target = std::move(dsn::host_port(obj.field)); \
} \
#define HOST_PORT(obj, field, target) \
do { \
if (obj.__isset.hp_##field) { \
target = obj.hp_##field; \
} else { \
target = std::move(dsn::host_port(obj.field)); \
} \
} while (0)

namespace dsn {
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);
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 dd36427

Please sign in to comment.