Flaugh24 commented on code in PR #1569:
URL: https://github.com/apache/ignite-3/pull/1569#discussion_r1121578156
##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterManagementGroupManager.java:
##########
@@ -366,6 +391,47 @@ private void onElectedAsLeader(long term) {
LOG.warn("Error when executing onLeaderElected
callback", e);
}
});
+
+
raftServiceAfterJoin().thenCompose(this::pushAuthenticationConfigToCluster);
+
+ }
+
+ private CompletableFuture<Void>
pushAuthenticationConfigToCluster(CmgRaftService service) {
+ return service.readClusterState()
+ .thenCompose(state -> {
+ if (state == null) {
+ LOG.info("No CMG state found in the Raft storage");
+ return completedFuture(null);
+ } else if (state.restAuthToApply() == null) {
+ // auth config has already been successfully pushed to
the distributed configuration
+ LOG.info("No REST auth configuration found in the Raft
storage");
+ return completedFuture(null);
+ } else {
+ LOG.info("REST auth configuration found in the Raft
storage, going to apply it");
+ RestAuthentication restAuthToApply =
state.restAuthToApply();
+ return
distributedConfigurationUpdater.updateRestAuthConfiguration(toRestAuthenticationConfig(restAuthToApply))
Review Comment:
RestAuthenticationConfig is used in java API. RestAuthentication is used for
messaging. So we need both.
About DistributedConfigurationUpdater, I would like to avoid using messaging
classes there and use different classes for different application layers.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]