murblanc commented on a change in pull request #403:
URL: https://github.com/apache/solr/pull/403#discussion_r773779415
##########
File path: solr/core/src/java/org/apache/solr/core/CoreContainer.java
##########
@@ -944,6 +946,14 @@ public void load() {
});
clusterSingletons.setReady();
+ if
(NodeRoles.PREFERRED.equals(nodeRoles.getRoleMode(NodeRoles.Role.OVERSEER))) {
+ try {
+ log.info("This node is started as a preferred overseer");
+ zkSys.getZkController().setPreferredOverseer();
+ } catch (KeeperException | InterruptedException e) {
+ throw new SolrException(ErrorCode.SERVER_ERROR, e);
+ }
+ }
if (!distributedCollectionCommandRunner.isPresent()) {
Review comment:
You can't do Overseer related actions if Overseer is not used in the
cluster that is configured for distributed cluster state change and collection
API.
So the code should instead look like:
```
if (!distributedCollectionCommandRunner.isPresent()) {
if
(NodeRoles.PREFERRED.equals(nodeRoles.getRoleMode(NodeRoles.Role.OVERSEER))) {
try {
log.info("This node is started as a preferred overseer");
zkSys.getZkController().setPreferredOverseer();
} catch (KeeperException | InterruptedException e) {
throw new SolrException(ErrorCode.SERVER_ERROR, e);
}
}
zkSys.getZkController().checkOverseerDesignate();
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]