You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/07/18 11:32:33 UTC

[GitHub] [incubator-pegasus] WHBANG opened a new pull request, #1061: feature: The conf server_list of meta_server support use fqdn:port

WHBANG opened a new pull request, #1061:
URL: https://github.com/apache/incubator-pegasus/pull/1061

   ### What problem does this PR solve? <!--add issue link with summary if exists-->
   https://github.com/apache/incubator-pegasus/issues/1058
   
   ### What is changed and how does it work?
   meta server conf change:
   `[meta_server]
   server_list = hybrid01.com.deployoctopus-xxx-debugbox:8170`
   
   
   ##### Tests <!-- At least one of them must be included. -->
   - Manual test (add detailed scripts or steps below)
   1. change the configuration server_list of the meta server to fqdn:port 
   2. The service can be started 
   3. The related pegasus shell is running normally
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org


[GitHub] [incubator-pegasus] foreverneverer merged pull request #1061: feat: The conf server_list of meta_server support use fqdn:port

Posted by GitBox <gi...@apache.org>.
foreverneverer merged PR #1061:
URL: https://github.com/apache/incubator-pegasus/pull/1061


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org


[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1061: feat: The conf server_list of meta_server support use fqdn:port

Posted by GitBox <gi...@apache.org>.
acelyc111 commented on code in PR #1061:
URL: https://github.com/apache/incubator-pegasus/pull/1061#discussion_r925257714


##########
src/rdsn/src/common/replication_common.cpp:
##########
@@ -477,7 +477,23 @@ bool replica_helper::load_meta_servers(/*out*/ std::vector<dsn::rpc_address> &se
     ::dsn::utils::split_args(server_list.c_str(), lv, ',');
     for (auto &s : lv) {
         ::dsn::rpc_address addr;
-        if (!addr.from_string_ipv4(s.c_str())) {
+        std::vector<std::string> hostname_port;
+        uint32_t ip = 0;
+        utils::split_args(s.c_str(), hostname_port, ':');
+        dassert(2 == hostname_port.size(),
+                "invalid address '{}' specified in config [{}].{}",
+                s.c_str(),
+                section,
+                key);
+        unsigned int port_num;
+        dassert(dsn::internal::buf2unsigned(hostname_port[1], port_num) && port_num < UINT16_MAX,

Review Comment:
   `dassert_f`



##########
src/rdsn/src/common/replication_common.cpp:
##########
@@ -477,7 +477,23 @@ bool replica_helper::load_meta_servers(/*out*/ std::vector<dsn::rpc_address> &se
     ::dsn::utils::split_args(server_list.c_str(), lv, ',');
     for (auto &s : lv) {
         ::dsn::rpc_address addr;
-        if (!addr.from_string_ipv4(s.c_str())) {
+        std::vector<std::string> hostname_port;
+        uint32_t ip = 0;
+        utils::split_args(s.c_str(), hostname_port, ':');
+        dassert(2 == hostname_port.size(),
+                "invalid address '{}' specified in config [{}].{}",
+                s.c_str(),
+                section,
+                key);
+        unsigned int port_num;
+        dassert(dsn::internal::buf2unsigned(hostname_port[1], port_num) && port_num < UINT16_MAX,
+                "invalid address '{}' specified in config [{}].{}",
+                s.c_str(),
+                section,
+                key);
+        if (0 != (ip = ::dsn::rpc_address::ipv4_from_host(hostname_port[0].c_str()))) {
+            addr.assign_ipv4(ip, (uint16_t)port_num);

Review Comment:
   use `static_cast<uint16_t>` instead



##########
src/rdsn/src/common/replication_common.cpp:
##########
@@ -477,7 +477,23 @@ bool replica_helper::load_meta_servers(/*out*/ std::vector<dsn::rpc_address> &se
     ::dsn::utils::split_args(server_list.c_str(), lv, ',');
     for (auto &s : lv) {
         ::dsn::rpc_address addr;
-        if (!addr.from_string_ipv4(s.c_str())) {
+        std::vector<std::string> hostname_port;
+        uint32_t ip = 0;
+        utils::split_args(s.c_str(), hostname_port, ':');
+        dassert(2 == hostname_port.size(),
+                "invalid address '{}' specified in config [{}].{}",
+                s.c_str(),
+                section,
+                key);
+        unsigned int port_num;

Review Comment:
   assign a init value to avoid compile complains on some platforms.



##########
src/rdsn/src/common/replication_common.cpp:
##########
@@ -477,7 +477,23 @@ bool replica_helper::load_meta_servers(/*out*/ std::vector<dsn::rpc_address> &se
     ::dsn::utils::split_args(server_list.c_str(), lv, ',');
     for (auto &s : lv) {
         ::dsn::rpc_address addr;
-        if (!addr.from_string_ipv4(s.c_str())) {
+        std::vector<std::string> hostname_port;
+        uint32_t ip = 0;
+        utils::split_args(s.c_str(), hostname_port, ':');
+        dassert(2 == hostname_port.size(),
+                "invalid address '{}' specified in config [{}].{}",
+                s.c_str(),
+                section,
+                key);
+        unsigned int port_num;

Review Comment:
   `uint32_t`



##########
src/rdsn/src/common/replication_common.cpp:
##########
@@ -477,7 +477,23 @@ bool replica_helper::load_meta_servers(/*out*/ std::vector<dsn::rpc_address> &se
     ::dsn::utils::split_args(server_list.c_str(), lv, ',');
     for (auto &s : lv) {
         ::dsn::rpc_address addr;
-        if (!addr.from_string_ipv4(s.c_str())) {
+        std::vector<std::string> hostname_port;
+        uint32_t ip = 0;
+        utils::split_args(s.c_str(), hostname_port, ':');
+        dassert(2 == hostname_port.size(),

Review Comment:
   use `dassert_f` instead



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org