You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "fmxxxx (via GitHub)" <gi...@apache.org> on 2023/12/21 04:25:48 UTC
[PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
fmxxxx opened a new pull request, #28770:
URL: https://github.com/apache/doris/pull/28770
## Proposed changes
My organization try to run TPC-DS 100G HMS Lake query. During the testing process, we encountered the following issues.
- when BrokerFileSystem listLocatedFiles, many such errors have occurred. `Socket is closed by peer` . After debugging, we found that the broker thrift client connection was closed.

This pr adds ping request during validate broker thrift client to avoid using abnormal clients.
## 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
Re: [PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
Posted by "fmxxxx (via GitHub)" <gi...@apache.org>.
fmxxxx commented on code in PR #28770:
URL: https://github.com/apache/doris/pull/28770#discussion_r1433627443
##########
fe/fe-core/src/main/java/org/apache/doris/common/BrokerGenericPool.java:
##########
@@ -0,0 +1,59 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.common;
+
+import org.apache.doris.thrift.TBrokerOperationStatus;
+import org.apache.doris.thrift.TBrokerOperationStatusCode;
+import org.apache.doris.thrift.TBrokerPingBrokerRequest;
+import org.apache.doris.thrift.TBrokerVersion;
+import org.apache.doris.thrift.TNetworkAddress;
+import org.apache.doris.thrift.TPaloBrokerService;
+
+import org.apache.commons.pool2.PooledObject;
+import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
+import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class BrokerGenericPool extends GenericPool {
+
+ private static final Logger LOG = LogManager.getLogger(BrokerGenericPool.class);
+
+ public BrokerGenericPool(String className, GenericKeyedObjectPoolConfig config, int timeoutMs) {
+ super(className, config, timeoutMs);
+ BrokerThriftClientFactory factory = new BrokerThriftClientFactory();
+ pool = new GenericKeyedObjectPool<>(factory, config);
+ }
+
+ private class BrokerThriftClientFactory extends ThriftClientFactory {
+ @Override
+ public boolean validateObject(TNetworkAddress key, PooledObject p) {
+ try {
+ TBrokerPingBrokerRequest request = new TBrokerPingBrokerRequest(TBrokerVersion.VERSION_ONE,
+ key.getHostname());
Review Comment:
done
--
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
Re: [PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
Posted by "fmxxxx (via GitHub)" <gi...@apache.org>.
fmxxxx commented on PR #28770:
URL: https://github.com/apache/doris/pull/28770#issuecomment-1865554613
@WinkerDu @morningman @chenlinzhong Please take a review, thank you.
--
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
Re: [PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
Posted by "WinkerDu (via GitHub)" <gi...@apache.org>.
WinkerDu commented on code in PR #28770:
URL: https://github.com/apache/doris/pull/28770#discussion_r1433616084
##########
fe/fe-core/src/main/java/org/apache/doris/common/BrokerGenericPool.java:
##########
@@ -0,0 +1,59 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.common;
+
+import org.apache.doris.thrift.TBrokerOperationStatus;
+import org.apache.doris.thrift.TBrokerOperationStatusCode;
+import org.apache.doris.thrift.TBrokerPingBrokerRequest;
+import org.apache.doris.thrift.TBrokerVersion;
+import org.apache.doris.thrift.TNetworkAddress;
+import org.apache.doris.thrift.TPaloBrokerService;
+
+import org.apache.commons.pool2.PooledObject;
+import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
+import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class BrokerGenericPool extends GenericPool {
+
+ private static final Logger LOG = LogManager.getLogger(BrokerGenericPool.class);
+
+ public BrokerGenericPool(String className, GenericKeyedObjectPoolConfig config, int timeoutMs) {
+ super(className, config, timeoutMs);
+ BrokerThriftClientFactory factory = new BrokerThriftClientFactory();
+ pool = new GenericKeyedObjectPool<>(factory, config);
+ }
+
+ private class BrokerThriftClientFactory extends ThriftClientFactory {
+ @Override
+ public boolean validateObject(TNetworkAddress key, PooledObject p) {
+ try {
+ TBrokerPingBrokerRequest request = new TBrokerPingBrokerRequest(TBrokerVersion.VERSION_ONE,
+ key.getHostname());
Review Comment:
fix the code style first
--
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
Re: [PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
Posted by "fmxxxx (via GitHub)" <gi...@apache.org>.
fmxxxx commented on PR #28770:
URL: https://github.com/apache/doris/pull/28770#issuecomment-1865683448
run buildall.
--
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
Re: [PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28770:
URL: https://github.com/apache/doris/pull/28770#issuecomment-1867185752
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
Re: [PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
Posted by "WinkerDu (via GitHub)" <gi...@apache.org>.
WinkerDu commented on PR #28770:
URL: https://github.com/apache/doris/pull/28770#issuecomment-1866213263
LGTM
--
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
Re: [PR] [Enhancement](FE) add ping request when validate broker thrift client [doris]
Posted by "fmxxxx (via GitHub)" <gi...@apache.org>.
fmxxxx commented on PR #28770:
URL: https://github.com/apache/doris/pull/28770#issuecomment-1865554865
run buildall.
--
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