Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FQDN): Support to communicate with servers and clients by host_port #1658

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

GehaFearless
Copy link
Contributor

@GehaFearless GehaFearless commented Oct 26, 2023

issue: #1659

  1. Add a new host_port type field if rpc_address field exists in IDL structures.
  2. Use both rpc_address and the optional host_port fields in C++ code.
  3. Use host_port to communicate with remote nodes firstly.

TODO:

  • Make sure everything works well after upgrading from old versions without any config changes
  • Make sure old version client is able to access the new version cluster
  • Make sure new version client is able to access the old version cluster

NOTE:
It's not able to upgrade Pegasus cluster and clients smoothly to the new version with FQDN enabled, it's needed to follow the steps if you want to enable the FQDN feature:

  1. Stop the cluster and clients
  2. Set the new configs (using hostnames instead of IPs)
  3. Rebuild the metadata of the cluster (See https://pegasus.apache.org/zh/administration/meta-recovery)
  4. Start the whole cluster and application clients

NOTE: Do not support rolling restart servers in the cluster with FQDN related configs changed

@GehaFearless GehaFearless changed the title Liguohao fqdn2 feat(FQDN): Replace rpc_address to host_prot for function & Add host_port on thrift struct Oct 26, 2023
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 4 times, most recently from faec076 to 2e6e527 Compare November 8, 2023 09:24
run.sh Outdated Show resolved Hide resolved
src/client/partition_resolver.cpp Outdated Show resolved Hide resolved
src/client/partition_resolver_simple.cpp Outdated Show resolved Hide resolved
src/client/replication_ddl_client.cpp Show resolved Hide resolved
src/client/replication_ddl_client.cpp Outdated Show resolved Hide resolved
src/common/replication_common.cpp Outdated Show resolved Hide resolved
src/failure_detector/failure_detector.cpp Outdated Show resolved Hide resolved
src/failure_detector/failure_detector.cpp Show resolved Hide resolved
src/meta/cluster_balance_policy.cpp Outdated Show resolved Hide resolved
src/meta/greedy_load_balancer.cpp Outdated Show resolved Hide resolved
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 2 times, most recently from 25c9fdd to a1fd9e0 Compare November 28, 2023 06:59
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 5 times, most recently from 5acccd7 to 47adb77 Compare December 8, 2023 09:56
@acelyc111
Copy link
Member

Some changes can be separated to another patch, for example, the changes in:

  1. src/common/json_helper.h and its tests.
  2. src/runtime/rpc/rpc_host_port.h (add some tests as well)

run.sh Show resolved Hide resolved
run.sh Outdated Show resolved Hide resolved
run.sh Show resolved Hide resolved
src/client/partition_resolver.cpp Outdated Show resolved Hide resolved
src/client/partition_resolver_simple.cpp Outdated Show resolved Hide resolved
src/meta/meta_bulk_load_service.cpp Outdated Show resolved Hide resolved
src/meta/meta_bulk_load_service.cpp Outdated Show resolved Hide resolved
src/meta/meta_bulk_load_service.cpp Outdated Show resolved Hide resolved
src/meta/meta_bulk_load_service.cpp Outdated Show resolved Hide resolved
src/meta/meta_data.cpp Outdated Show resolved Hide resolved
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 5 times, most recently from 6ff7b18 to b3368ad Compare December 25, 2023 12:34
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 2 times, most recently from 612b1aa to 9a0e467 Compare December 28, 2023 07:55
src/test/function_test/recovery/test_recovery.cpp Outdated Show resolved Hide resolved
src/test/function_test/base_api/test_batch_get.cpp Outdated Show resolved Hide resolved
src/shell/commands/detect_hotkey.cpp Outdated Show resolved Hide resolved
src/client/replication_ddl_client.cpp Outdated Show resolved Hide resolved
src/client/replication_ddl_client.cpp Outdated Show resolved Hide resolved
src/meta/app_balance_policy.cpp Outdated Show resolved Hide resolved
src/meta/app_balance_policy.cpp Outdated Show resolved Hide resolved
@acelyc111 acelyc111 force-pushed the liguohao_fqdn2 branch 2 times, most recently from cdde494 to 718a6a0 Compare February 4, 2024 08:31
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 3 times, most recently from 936a7ab to cb5f3b9 Compare February 7, 2024 07:02
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 6 times, most recently from 6fc12e5 to e2a6fa2 Compare February 20, 2024 02:41
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 5 times, most recently from 61335d2 to 5e7af7b Compare March 4, 2024 06:11
@GehaFearless GehaFearless force-pushed the liguohao_fqdn2 branch 3 times, most recently from 9df655a to 818b1d0 Compare March 8, 2024 09:04
@GehaFearless GehaFearless changed the title feat(FQDN): Replace rpc_address to host_prot for function & Add host_port on thrift struct feat(FQDN): Replace rpc_address to host_port for function & Add host_port on thrift struct Mar 11, 2024
src/meta/test/meta_bulk_load_service_test.cpp Show resolved Hide resolved
src/meta/test/meta_test_base.cpp Show resolved Hide resolved
src/meta/test/misc/misc.h Show resolved Hide resolved
src/shell/commands/rebalance.cpp Show resolved Hide resolved
src/shell/commands/table_management.cpp Show resolved Hide resolved
@@ -75,8 +75,8 @@ rpc_timeout_milliseconds = 5000
lb_interval_ms = 3000

[pegasus.clusters]
onebox = 127.0.0.1:34601,127.0.0.1:34602,127.0.0.1:34603
single_master_cluster = 127.0.0.1:34601
onebox = @LOCAL_HOSTNAME@:34601,@LOCAL_HOSTNAME@:34602,@LOCAL_HOSTNAME@:34603
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: check ip is acceptable as well

result.reserve(ports.size());
for (const auto &port : ports) {
result.emplace_back(dsn::rpc_address(global_env::instance()._host_ip, port));
char hostname[1024];
gethostname(hostname, 1024);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: change _host_ip and use it

@@ -89,6 +89,7 @@ void test_util::SetUp()
ddl_client_ = std::make_shared<replication_ddl_client>(meta_list_);
ASSERT_TRUE(ddl_client_ != nullptr);
ddl_client_->set_max_wait_app_ready_secs(120);
ddl_client_->set_meta_servers_leader();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: is it necessary?

@acelyc111 acelyc111 changed the title feat(FQDN): Replace rpc_address to host_port for function & Add host_port on thrift struct feat(FQDN): Support to communicate with servers and clients by host_port Mar 13, 2024
@empiredan empiredan merged commit 802d2c2 into apache:master Mar 13, 2024
167 of 177 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants