bharatviswa504 commented on a change in pull request #2113:
URL: https://github.com/apache/ozone/pull/2113#discussion_r608409025
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAInvocationHandler.java
##########
@@ -89,11 +90,29 @@ private Object invokeRatis(Method method, Object[] args)
throws Exception {
long startTime = Time.monotonicNowNanos();
Preconditions.checkNotNull(ratisHandler);
- final SCMRatisResponse response = ratisHandler.submitRequest(
- SCMRatisRequest.of(requestType, method.getName(),
- method.getParameterTypes(), args));
+ SCMRatisRequest scmRatisRequest = SCMRatisRequest.of(requestType,
+ method.getName(), method.getParameterTypes(), args);
+
+ // Scm Cert DB updates should use RaftClient.
+ // As rootCA which is primary SCM only can issues certificates to sub-CA.
+ // In case primary is not leader SCM, still sub-ca cert DB updates should
go
+ // via ratis. So, in this special scenario we use RaftClient.
+ final SCMRatisResponse response;
+ if (method.getName().equals("storeValidCertificate") &&
+ args[args.length -1].equals(HddsProtos.NodeType.SCM)) {
+ response =
Review comment:
this is needed only for scm signed certs, for others like om/dn we still
need to go via normal route.
This is the reason for this approach.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]