GlenGeng commented on a change in pull request #2113:
URL: https://github.com/apache/ozone/pull/2113#discussion_r608405214
##########
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:
How about remove `replicate` annotation for `storeValidCertificate`, and
directly call HASecurityUtils.submitScmCertsToRatis() there ? It should be
simpler and easier to maintain.
--
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]