You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/11/08 06:24:49 UTC
[GitHub] [doris] zhengshengjun opened a new pull request, #14063: [Feature] Support IPV6
zhengshengjun opened a new pull request, #14063:
URL: https://github.com/apache/doris/pull/14063
# Proposed changes
Issue Number: close #xxx
## Problem summary
Describe your changes.
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [ ] No
- [ ] I don't know
2. Has unit tests been added:
- [ ] Yes
- [ ] No
- [ ] No Need
3. Has document been added or modified:
- [ ] Yes
- [ ] No
- [ ] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [ ] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [ ] No
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1375260317
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hello-stephen commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1374880073
TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 34.71 seconds
load time: 475 seconds
storage size: 17122864446 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230108165541_clickbench_pr_75725.html
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman merged pull request #14063: [Feature](ipv6)Support IPV6
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman merged PR #14063:
URL: https://github.com/apache/doris/pull/14063
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1376728694
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1378711692
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1427240495
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1379000818
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1103818977
##########
be/src/util/network_util.cpp:
##########
@@ -39,22 +39,38 @@
namespace doris {
InetAddress::InetAddress(struct sockaddr* addr) {
- this->addr = *(struct sockaddr_in*)addr;
+ this->addr = *(struct sockaddr_storage*)addr;
}
-bool InetAddress::is_address_v4() const {
- return addr.sin_family == AF_INET;
+bool InetAddress::is_loopback() {
+ if (addr.ss_family == AF_INET) {
+ in_addr_t s_addr = ((struct sockaddr_in*)&addr)->sin_addr.s_addr;
+ return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+ } else if (addr.ss_family == AF_INET6) {
+ struct in6_addr in6_addr = ((struct sockaddr_in6*)&addr)->sin6_addr;
+ return IN6_IS_ADDR_LOOPBACK(&in6_addr);
+ } else {
+ LOG(WARNING) << "unknown address family: " << addr.ss_family;
+ return false;
+ }
}
-bool InetAddress::is_loopback_v4() {
- in_addr_t s_addr = addr.sin_addr.s_addr;
- return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+std::string InetAddress::get_host_address() {
+ if (addr.ss_family == AF_INET) {
+ char addr_buf[INET_ADDRSTRLEN];
+ inet_ntop(AF_INET, &(((struct sockaddr_in*)&addr)->sin_addr), addr_buf, INET_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else if (addr.ss_family == AF_INET6) {
+ char addr_buf[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, &(((struct sockaddr_in6*)&addr)->sin6_addr), addr_buf,
+ INET6_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else {
+ return std::string {"unknown address family: " + addr.ss_family};
Review Comment:
warning: adding 'sa_family_t' (aka 'unsigned short') to a string does not append to the string [clang-diagnostic-string-plus-int]
```cpp
return std::string {"unknown address family: " + addr.ss_family};
^
```
**be/src/util/network_util.cpp:68:** use array indexing to silence this warning
```cpp
return std::string {"unknown address family: " + addr.ss_family};
^
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1064164750
##########
be/src/util/brpc_client_cache.h:
##########
@@ -54,13 +54,18 @@ class BrpcClientCache {
}
#else
std::shared_ptr<T> get_client(const TNetworkAddress& taddr) {
- std::string host_port = fmt::format("{}:{}", taddr.hostname, taddr.port);
- return get_client(host_port);
+ return get_client(taddr.hostname, taddr.port);
}
#endif
std::shared_ptr<T> get_client(const std::string& host, int port) {
- std::string host_port = fmt::format("{}:{}", host, port);
+ std::string host_port;
+ //if host is an ipv6 address and not starts with Bracket
+ if (host.find(":") != std::string::npos && host[0] != '[') {
Review Comment:
warning: 'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character [performance-faster-string-find]
```suggestion
if (host.find(':') != std::string::npos && host[0] != '[') {
```
##########
be/src/util/network_util.cpp:
##########
@@ -183,4 +196,23 @@
return Status::OK();
}
+std::string get_host_port(const std::string& host, int port) {
+ std::stringstream ss;
+ if (host.find(":") == std::string::npos) {
Review Comment:
warning: 'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character [performance-faster-string-find]
```suggestion
if (host.find(':') == std::string::npos) {
```
##########
be/test/util/cidr_test.cpp:
##########
@@ -52,6 +52,16 @@ TEST(CIDR, contains) {
EXPECT_TRUE(cidr.reset("192.168.17.0/16"));
EXPECT_TRUE(cidr.contains("192.168.88.99"));
Review Comment:
warning: no matching member function for call to 'contains' [clang-diagnostic-error]
```cpp
EXPECT_TRUE(cidr.contains("192.168.88.99"));
^
```
**thirdparty/installed/include/gtest/gtest.h:1981:** expanded from macro 'EXPECT_TRUE'
```cpp
#define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition)
^
```
**thirdparty/installed/include/gtest/gtest.h:1965:** expanded from macro 'GTEST_EXPECT_TRUE'
```cpp
GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
^
```
**thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_'
```cpp
::testing::AssertionResult(expression)) \
^
```
**be/src/util/cidr.h:34:** candidate function not viable: no known conversion from 'const char[14]' to 'uint32_t' (aka 'unsigned int') for 1st argument
```cpp
bool contains(uint32_t ip_int);
^
```
**be/src/util/cidr.h:31:** candidate function not viable: no known conversion from 'const char[14]' to 'const doris::CIDR' for 1st argument
```cpp
bool contains(const CIDR& ip) const;
^
```
##########
be/src/util/network_util.cpp:
##########
@@ -39,22 +39,38 @@
namespace doris {
InetAddress::InetAddress(struct sockaddr* addr) {
- this->addr = *(struct sockaddr_in*)addr;
+ this->addr = *(struct sockaddr_storage*)addr;
}
-bool InetAddress::is_address_v4() const {
- return addr.sin_family == AF_INET;
+bool InetAddress::is_loopback() {
+ if (addr.ss_family == AF_INET) {
+ in_addr_t s_addr = ((struct sockaddr_in*)&addr)->sin_addr.s_addr;
+ return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+ } else if (addr.ss_family == AF_INET6) {
+ struct in6_addr in6_addr = ((struct sockaddr_in6*)&addr)->sin6_addr;
+ return IN6_IS_ADDR_LOOPBACK(&in6_addr);
+ } else {
+ LOG(WARNING) << "unknow address";
+ return false;
+ }
}
-bool InetAddress::is_loopback_v4() {
- in_addr_t s_addr = addr.sin_addr.s_addr;
- return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+std::string InetAddress::get_host_address() {
+ if (addr.ss_family == AF_INET) {
+ char addr_buf[INET_ADDRSTRLEN];
+ inet_ntop(AF_INET, &(((struct sockaddr_in*)&addr)->sin_addr), addr_buf, INET_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else if (addr.ss_family == AF_INET6) {
+ char addr_buf[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, &(((struct sockaddr_in6*)&addr)->sin6_addr), addr_buf,
+ INET6_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else {
+ return std::string {"unknown address"};
+ }
}
-
-std::string InetAddress::get_host_address_v4() {
- char addr_buf[INET_ADDRSTRLEN];
- inet_ntop(AF_INET, &(addr.sin_addr), addr_buf, INET_ADDRSTRLEN);
- return std::string(addr_buf);
+bool InetAddress::is_ipv6() {
Review Comment:
warning: method 'is_ipv6' can be made const [readability-make-member-function-const]
```suggestion
bool InetAddress::is_ipv6() const {
```
be/src/util/network_util.h:34:
```diff
- bool is_ipv6();
+ bool is_ipv6() const;
```
##########
be/test/util/cidr_test.cpp:
##########
@@ -52,6 +52,16 @@
EXPECT_TRUE(cidr.reset("192.168.17.0/16"));
EXPECT_TRUE(cidr.contains("192.168.88.99"));
EXPECT_FALSE(cidr.contains("192.2.88.99"));
Review Comment:
warning: no matching member function for call to 'contains' [clang-diagnostic-error]
```cpp
EXPECT_FALSE(cidr.contains("192.2.88.99"));
^
```
**thirdparty/installed/include/gtest/gtest.h:1985:** expanded from macro 'EXPECT_FALSE'
```cpp
#define EXPECT_FALSE(condition) GTEST_EXPECT_FALSE(condition)
^
```
**thirdparty/installed/include/gtest/gtest.h:1968:** expanded from macro 'GTEST_EXPECT_FALSE'
```cpp
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
^
```
**thirdparty/installed/include/gtest/internal/gtest-internal.h:1501:** expanded from macro 'GTEST_TEST_BOOLEAN_'
```cpp
::testing::AssertionResult(expression)) \
^
```
**be/src/util/cidr.h:34:** candidate function not viable: no known conversion from 'const char[12]' to 'uint32_t' (aka 'unsigned int') for 1st argument
```cpp
bool contains(uint32_t ip_int);
^
```
**be/src/util/cidr.h:31:** candidate function not viable: no known conversion from 'const char[12]' to 'const doris::CIDR' for 1st argument
```cpp
bool contains(const CIDR& ip) const;
^
```
##########
be/src/util/network_util.cpp:
##########
@@ -183,4 +196,23 @@
return Status::OK();
}
+std::string get_host_port(const std::string& host, int port) {
+ std::stringstream ss;
+ if (host.find(":") == std::string::npos) {
+ ss << host << ":" << port;
+ } else {
+ ss << "[" << host << "]"
+ << ":" << port;
+ }
+ return ss.str();
+}
+
+std::string get_brpc_http_url(const std::string& host, int port) {
+ if (host.find(":") != std::string::npos) {
Review Comment:
warning: 'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character [performance-faster-string-find]
```suggestion
if (host.find(':') != std::string::npos) {
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1379710733
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman commented on a diff in pull request #14063: [Feature](ipv6)Support IPV6
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1103756592
##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/BaseController.java:
##########
@@ -296,6 +296,6 @@ protected long checkLongParam(String strParam) {
}
protected String getCurrentFrontendURL() {
- return "http://" + FrontendOptions.getLocalHostAddress() + ":" + Config.http_port;
+ return "http://" + FrontendOptions.getHostname() + ":" + Config.http_port;
Review Comment:
What is diff between `getLocalHostAddress` and `getHostname`?
##########
be/src/util/network_util.cpp:
##########
@@ -39,22 +39,38 @@
namespace doris {
InetAddress::InetAddress(struct sockaddr* addr) {
- this->addr = *(struct sockaddr_in*)addr;
+ this->addr = *addr;
}
-bool InetAddress::is_address_v4() const {
- return addr.sin_family == AF_INET;
+bool InetAddress::is_loopback() {
+ if (addr.sa_family == AF_INET) {
+ in_addr_t s_addr = ((struct sockaddr_in*)&addr)->sin_addr.s_addr;
+ return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+ } else if (addr.sa_family == AF_INET6) {
+ struct in6_addr in6_addr = ((struct sockaddr_in6*)&addr)->sin6_addr;
+ return IN6_IS_ADDR_LOOPBACK(&in6_addr);
+ } else {
+ LOG(WARNING) << "unknow address";
Review Comment:
```suggestion
LOG(WARNING) << "unknow address: " << addr.sa_family;
```
##########
be/src/util/network_util.cpp:
##########
@@ -39,22 +39,38 @@
namespace doris {
InetAddress::InetAddress(struct sockaddr* addr) {
- this->addr = *(struct sockaddr_in*)addr;
+ this->addr = *addr;
}
-bool InetAddress::is_address_v4() const {
- return addr.sin_family == AF_INET;
+bool InetAddress::is_loopback() {
+ if (addr.sa_family == AF_INET) {
+ in_addr_t s_addr = ((struct sockaddr_in*)&addr)->sin_addr.s_addr;
+ return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+ } else if (addr.sa_family == AF_INET6) {
+ struct in6_addr in6_addr = ((struct sockaddr_in6*)&addr)->sin6_addr;
+ return IN6_IS_ADDR_LOOPBACK(&in6_addr);
+ } else {
+ LOG(WARNING) << "unknow address";
+ return false;
+ }
}
-bool InetAddress::is_loopback_v4() {
- in_addr_t s_addr = addr.sin_addr.s_addr;
- return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+std::string InetAddress::get_host_address() {
+ if (addr.sa_family == AF_INET) {
+ char addr_buf[INET_ADDRSTRLEN];
+ inet_ntop(AF_INET, &(((struct sockaddr_in*)&addr)->sin_addr), addr_buf, INET_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else if (addr.sa_family == AF_INET6) {
+ char addr_buf[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, &(((struct sockaddr_in6*)&addr)->sin6_addr), addr_buf,
+ INET6_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else {
+ return std::string {"unknown address"};
Review Comment:
```suggestion
return std::string {"unknown address: " + addr.sa_family};
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hf200012 commented on a diff in pull request #14063: [Feature] Support IPV6
Posted by GitBox <gi...@apache.org>.
hf200012 commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1022598094
##########
fe/pom.xml:
##########
@@ -181,7 +181,7 @@ under the License.
<java-cup.version>0.11-a-czt02-cdh</java-cup.version>
<javassist.version>3.18.2-GA</javassist.version>
<javax.servlet-api.version>3.0.1</javax.servlet-api.version>
- <je.version>18.3.13-doris-SNAPSHOT</je.version>
+ <je.version>18.3.14-doris-SNAPSHOT</je.version>
Review Comment:
```suggestion
<je.version>18.3.13-doris-SNAPSHOT</je.version>
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morningman commented on a diff in pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
morningman commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1023867940
##########
be/src/service/brpc_service.cpp:
##########
@@ -49,7 +49,18 @@ Status BRpcService::start(int port, int num_threads) {
options.num_threads = num_threads;
}
- if (_server->Start(port, &options) != 0) {
+ butil::EndPoint point;
+ const char* host;
Review Comment:
extract a method
##########
be/src/runtime/data_stream_sender.cpp:
##########
@@ -164,8 +164,14 @@ Status DataStreamSender::Channel::send_batch(PRowBatch* batch, bool eos) {
RefCountClosure<PTransmitDataResult>>(
&_brpc_request, _closure);
RETURN_IF_ERROR(st);
- std::string brpc_url =
- fmt::format("http://{}:{}", _brpc_dest_addr.hostname, _brpc_dest_addr.port);
+ std::string brpc_url;
+ //format an ipv6 address
Review Comment:
I think we should extract a method for this.
##########
fe/fe-core/src/main/java/org/apache/doris/qe/HelpModule.java:
##########
@@ -266,7 +266,8 @@ public void setUpModule() throws IOException, UserException {
URL helpResource = instance.getClass().getClassLoader()
.getResource(HELP_ZIP_FILE_NAME);
if (helpResource == null) {
- throw new IOException("Can not find help zip file: " + HELP_ZIP_FILE_NAME);
+ return;
+ // throw new IOException("Can not find help zip file: " + HELP_ZIP_FILE_NAME);
Review Comment:
Why modify this?
##########
be/src/util/brpc_client_cache.h:
##########
@@ -60,7 +60,17 @@ class BrpcClientCache {
std::shared_ptr<T> get_client(const std::string& host, int port) {
std::string host_port = fmt::format("{}:{}", host, port);
- return get_client(host_port);
+ std::shared_ptr<T> stub_ptr;
+ auto get_value = [&stub_ptr](typename StubMap<T>::mapped_type& v) { stub_ptr = v; };
+ if (LIKELY(_stub_map.if_contains(host_port, get_value))) {
+ return stub_ptr;
+ }
+
+ // new one stub and insert into map
Review Comment:
duplicate code
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1377088840
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1428070456
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1103816731
##########
be/src/util/network_util.cpp:
##########
@@ -39,22 +39,38 @@
namespace doris {
InetAddress::InetAddress(struct sockaddr* addr) {
- this->addr = *(struct sockaddr_in*)addr;
+ this->addr = *(struct sockaddr_storage*)addr;
}
-bool InetAddress::is_address_v4() const {
- return addr.sin_family == AF_INET;
+bool InetAddress::is_loopback() {
+ if (addr.ss_family == AF_INET) {
+ in_addr_t s_addr = ((struct sockaddr_in*)&addr)->sin_addr.s_addr;
+ return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+ } else if (addr.ss_family == AF_INET6) {
+ struct in6_addr in6_addr = ((struct sockaddr_in6*)&addr)->sin6_addr;
+ return IN6_IS_ADDR_LOOPBACK(&in6_addr);
+ } else {
+ LOG(WARNING) << "unknow address: " << addr.ss_family;;
+ return false;
+ }
}
-bool InetAddress::is_loopback_v4() {
- in_addr_t s_addr = addr.sin_addr.s_addr;
- return (ntohl(s_addr) & 0xFF000000) == 0x7F000000;
+std::string InetAddress::get_host_address() {
+ if (addr.ss_family == AF_INET) {
+ char addr_buf[INET_ADDRSTRLEN];
+ inet_ntop(AF_INET, &(((struct sockaddr_in*)&addr)->sin_addr), addr_buf, INET_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else if (addr.ss_family == AF_INET6) {
+ char addr_buf[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, &(((struct sockaddr_in6*)&addr)->sin6_addr), addr_buf,
+ INET6_ADDRSTRLEN);
+ return std::string(addr_buf);
+ } else {
+ return std::string {"unknown address: " + addr.ss_family};
Review Comment:
warning: adding 'sa_family_t' (aka 'unsigned short') to a string does not append to the string [clang-diagnostic-string-plus-int]
```cpp
return std::string {"unknown address: " + addr.ss_family};
^
```
**be/src/util/network_util.cpp:68:** use array indexing to silence this warning
```cpp
return std::string {"unknown address: " + addr.ss_family};
^
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1105194832
##########
be/src/util/network_util.cpp:
##########
@@ -38,23 +37,19 @@
namespace doris {
-InetAddress::InetAddress(struct sockaddr* addr) {
- this->addr = *(struct sockaddr_in*)addr;
-}
+InetAddress::InetAddress(std::string ip, sa_family_t family, bool is_loopback)
+ : _ip_addr(ip), _family(family), _is_loopback(is_loopback) {}
-bool InetAddress::is_address_v4() const {
- return addr.sin_family == AF_INET;
+bool InetAddress::is_loopback() {
Review Comment:
warning: method 'is_loopback' can be made const [readability-make-member-function-const]
```suggestion
bool InetAddress::is_loopback() const {
```
be/src/util/network_util.h:32:
```diff
- bool is_loopback();
+ bool is_loopback() const;
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hf200012 commented on a diff in pull request #14063: [Feature] Support IPV6
Posted by GitBox <gi...@apache.org>.
hf200012 commented on code in PR #14063:
URL: https://github.com/apache/doris/pull/14063#discussion_r1022598094
##########
fe/pom.xml:
##########
@@ -181,7 +181,7 @@ under the License.
<java-cup.version>0.11-a-czt02-cdh</java-cup.version>
<javassist.version>3.18.2-GA</javassist.version>
<javax.servlet-api.version>3.0.1</javax.servlet-api.version>
- <je.version>18.3.13-doris-SNAPSHOT</je.version>
+ <je.version>18.3.14-doris-SNAPSHOT</je.version>
Review Comment:
```suggestion
<je.version>18.3.13-doris-SNAPSHOT</je.version>
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1427285008
PR approved by at least one committer and no changes requested.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1427285062
PR approved by anyone and no changes requested.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1427051793
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1429255652
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14063: [Feature](ipv6)Support IPV6
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14063:
URL: https://github.com/apache/doris/pull/14063#issuecomment-1429512777
clang-tidy review says "All clean, LGTM! :+1:"
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org