Skip to content

Commit

Permalink
feat(FQDN): feather refator on idl/duplication.thrift
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Jul 26, 2024
1 parent 00a4fad commit eb81319
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions idl/duplication.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ struct duplication_sync_request
{
// the address of of the replica server who sends this request
// TODO(wutao1): remove this field and get the source address by dsn_msg_from_address
1:dsn.rpc_address node;
1:dsn.rpc_address node1;

2:map<dsn.gpid, list<duplication_confirm_entry>> confirm_list;
3:dsn.host_port hp_node;
3:dsn.host_port hp_node1;
}

struct duplication_sync_response
Expand Down
8 changes: 4 additions & 4 deletions src/meta/duplication/meta_duplication_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ void meta_duplication_service::duplication_sync(duplication_sync_rpc rpc)
auto &response = rpc.response();
response.err = ERR_OK;

host_port src_hp;
GET_HOST_PORT(request, node, src_hp);
const auto *ns = get_node_state(_state->_nodes, src_hp, false);
host_port src_node;
GET_HOST_PORT(request, node1, src_node);
const auto *ns = get_node_state(_state->_nodes, src_node, false);
if (ns == nullptr) {
LOG_WARNING("node({}) is not found in meta server", FMT_HOST_PORT_AND_IP(request, node));
LOG_WARNING("node({}) is not found in meta server", FMT_HOST_PORT_AND_IP(request, node1));
response.err = ERR_OBJECT_NOT_FOUND;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/meta/test/meta_duplication_service_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class meta_duplication_service_test : public meta_test_base
std::map<gpid, std::vector<duplication_confirm_entry>> confirm_list)
{
auto req = std::make_unique<duplication_sync_request>();
SET_IP_AND_HOST_PORT_BY_DNS(*req, node, hp);
SET_IP_AND_HOST_PORT_BY_DNS(*req, node1, hp);
req->confirm_list = confirm_list;

duplication_sync_rpc rpc(std::move(req), RPC_CM_DUPLICATION_SYNC);
Expand Down
2 changes: 1 addition & 1 deletion src/replica/duplication/duplication_sync_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void duplication_sync_timer::run()
}

auto req = std::make_unique<duplication_sync_request>();
SET_IP_AND_HOST_PORT(*req, node, _stub->primary_address(), _stub->primary_host_port());
SET_IP_AND_HOST_PORT(*req, node1, _stub->primary_address(), _stub->primary_host_port());

// collects confirm points from all primaries on this server
for (const replica_ptr &r : _stub->get_all_primaries()) {
Expand Down
4 changes: 2 additions & 2 deletions src/replica/duplication/test/duplication_sync_timer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class duplication_sync_timer_test : public duplication_test_base
ASSERT_EQ(duplication_sync_rpc::mail_box().size(), 1);

auto &req = duplication_sync_rpc::mail_box().back().request();
ASSERT_IP_AND_HOST_PORT(req, node, stub->primary_address(), stub->primary_host_port());
ASSERT_IP_AND_HOST_PORT(req, node1, stub->primary_address(), stub->primary_host_port());

// ensure confirm list is empty when no progress
ASSERT_EQ(0, req.confirm_list.size());
Expand All @@ -143,7 +143,7 @@ class duplication_sync_timer_test : public duplication_test_base
ASSERT_EQ(duplication_sync_rpc::mail_box().size(), 1);

auto &req = *duplication_sync_rpc::mail_box().back().mutable_request();
ASSERT_IP_AND_HOST_PORT(req, node, stub->primary_address(), stub->primary_host_port());
ASSERT_IP_AND_HOST_PORT(req, node1, stub->primary_address(), stub->primary_host_port());
ASSERT_EQ(req.confirm_list.size(), total_app_num);

for (int appid = 1; appid <= total_app_num; appid++) {
Expand Down

0 comments on commit eb81319

Please sign in to comment.