-
Notifications
You must be signed in to change notification settings - Fork 587
HDDS-3745. Improve OM and SCM performance with 64% by avoid collect datanode information to s3g #1031
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
Conversation
5757fd1 to
5e11bb4
Compare
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
Outdated
Show resolved
Hide resolved
5e11bb4 to
3325a78
Compare
|
@elek Could you help review this patch ? Thank you very much. |
|
Thanks the patch @runzhiwang It looks correct me, but it's also a question about the long-term usage of I agree, that long-term we should use proxy users for S3 and pooling the connections. Short-term this patch looks good to me, but why don't we use the I would be interested about the opinion of @nandakumar131. As far as I remember he worked on the original implementation. Personally I think a generic Let's wait for more opinions. |
|
Some background When Now I'm not even sure where and why |
For OM HA, the reason for not using the getServiceInfo was if client knows one of the OzoneManager addresses, and if that is down, client will not be able to talk to the ozone cluster. |
|
@bharatviswa504 I understand the reason behind it. We should revisit |
|
From the code point of I see the usage of getServiceInfo used to get CaCert and used by XceiverClientRatis and Grpc. Looking into the PR code now it has eliminated using this getServiceInfo, and added a new API for getcaCert when security is enabled. |
Agreed. I just want to give you a context for the above statement mentioned. |
|
@elek @nandakumar131 @bharatviswa504 Hi, Thanks for review. The problem of getServiceInfo is that it contains all the datanodes' information which cost too much if the cluster is big. If it only contain OM address, there is no need to replace it with |
|
@runzhiwang the reason the serviceinfo request retrieve all the DNs is for the DN REST service address. After the Ozone REST support was removed a while back, those leftover are not cleaned up completely. Maybe a time to clean that up to make it lighter without introducing a new RPC? |
|
@xiaoyuyao Thanks for explanation, I agree and I will clean that up. |
Thank You @runzhiwang for the explanation of the issue. I like @xiaoyuyao proposal, if DN information is no more required, we can clean that up, and use getServiceInfo instead of a new RPC call. |
5e78b07 to
a002f5f
Compare
f333972 to
13fb742
Compare
Codecov Report
@@ Coverage Diff @@
## master #1031 +/- ##
============================================
- Coverage 70.38% 70.33% -0.06%
+ Complexity 9234 9227 -7
============================================
Files 961 961
Lines 48130 48115 -15
Branches 4676 4674 -2
============================================
- Hits 33877 33842 -35
- Misses 12001 12020 +19
- Partials 2252 2253 +1 Continue to review full report at Codecov.
|
|
@xiaoyuyao @bharatviswa504 Thanks for review. I have updated the patch. |
|
Thank You for the update. |
I have some fear if the secre/unsecure cluster would have such difference. For example, I should run all the performance tests on secure cluster. We should be careful and execute all the tests on both secure / unsecure cluster. Seems to be safer to keep it as is. But I can be convinced. |
|
The getServiceInfo could be used for non-secure configuration from the server in future. I agree with @elek to leave it as-is. |
From code, I see that we use getServiceInfo value only when security is enabled. So, from S3G perspective, for each request, we can save one Rpc Call. I have not understood, what is the problem mentioned here, as from code we can see the value from getServiceInfo is only used when security is enabled. If someone has mistakenly used some of the information from getServiceInfo mistakenly with out initializing it, it will be caught immediately as it will throw NPE. And also we are not initializing serviceinfo, to any class parameter, it is locally used in the RpcClient constructor only. |
getServiceInfo is the service discovery API for OM, which is not for security only. If we go with the other route, i.e., a dedicated API for getCaCertificate(), I'm OK with including check for security enabled. |
|
But right now getServiceInfo is used only to getCaCertificate, other than that in current code there is no usage of it. As now the client does not need an SCM address, for OM, we get a quorum of address from config, and also we don't need DN address which this patch has eliminated. If we can skip getServiceInfo call in a non-secure cluster where we can save one RPC Call. I am fine with reusing this API or with totally a new API. |
|
So what's next here? I propose to merge this as is (clean simple patch, just remove the datanode part). If @bharatviswa504, @xiaoyuyao Are you ok with this approach? |
|
Fine with me. In this Jira let's focus on removing datanode part. I will open a new Jira for removing the usage of getServiceInfo. +1 LGTM. |
|
Thank You @runzhiwang for the contribution and @elek and @xiaoyuyao for the review. |
* upstream/master: (56 commits) HDDS-3264. Fix TestCSMMetrics.java. (apache#1120) HDDS-3858. Remove support to start Ozone and HDFS datanodes in the same JVM (apache#1117) HDDS-3704. Update all the documentation to use ozonefs-hadoop2/3 instead of legacy/current (apache#1099) HDDS-3773. Add OMDBDefinition to define structure of om.db. (apache#1076) Revert "HDDS-3263. Fix TestCloseContainerByPipeline.java. (apache#1119)" (apache#1126) HDDS-3821. Disable Ozone SPNEGO should not fall back to hadoop.http.a… (apache#1101) HDDS-3819. OzoneManager#listVolumeByUser ignores userName parameter when ACL is enabled (apache#1087) HDDS-3779. Add csi interface documents to show how to use ozone csi (apache#1059) HDDS-3857. Datanode in compose/ozonescripts can't be started (apache#1116) HDDS-3430. Enable TestWatchForCommit test cases. (apache#1114) HDDS-3263. Fix TestCloseContainerByPipeline.java. (apache#1119) HDDS-3512. s3g multi-part-upload saved incorrect content using streaming (apache#1092) HDDS-3836. Modify ContainerPlacementPolicyFactory JavaDoc (apache#1097) HDDS-3780. Replace the imagePullPolicy from always to IfNotPresent (apache#1055) HDDS-3847. Change OMNotLeaderException logging to DEBUG (apache#1118) HDDS-3745. Improve OM and SCM performance with 64% by avoid collect datanode information to s3g (apache#1031) HDDS-3286. BasicOzoneFileSystem support batchDelete. (apache#814) HDDS-3850. Update the admin document to let user know how to show the status of all rules. (apache#1109) HDDS-3848. Add ratis.thirdparty.version in main pom.xml (apache#1108) HDDS-3815. Avoid buffer copy in ContainerCommandRequestProto. (apache#1085) ...

What changes were proposed in this pull request?
What's the problem ?
I start a ozone cluster with 1000 datanodes and 10 s3gateway, and run two weeks with heavy workload, and perf om and scm.
2.From scm perf, queryNode come from om::getServiceList cost 33.20% cpu

What's the reason ?
Now s3g create a client for each request (we should improve it in the future). when create each
RpcClient, s3g will callozoneManagerClient.getServiceInfo(),getServiceInfowill callgetServiceList.getServiceListis a very heavy call, because it need to get DatanodeDetails of 1000 Datanodes, so om and scm are very busy withgetServiceList.But s3g does not use the List(ServiceInfo) which got from
getServiceListat all.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-3745
How was this patch tested?
Existed tests.