[ https://issues.apache.org/jira/browse/GEODE-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16427471#comment-16427471 ]
Sai Boorlagadda edited comment on GEODE-3237 at 4/5/18 7:16 PM: ---------------------------------------------------------------- Instead of failing the command and showing errors, the option itself will be deprecated. Currently this option takes (true/false, defaults to false) to let locator load cluster configuration from a specified directory provided with other option '--cluster-config-dir'. Also `--cluster-config-dir` is used to create the persistent disk store to store configuration region entries. There are couple of issues on how these two parameters work together. When starting a locator to join an existing cluster - 1) if option `-- load-cluster-config-from-dir` is set to true, then users have to provide a directory to load the configuration, failing to provide `-- cluster-config-dir` would cause the newly started locator to wipe out existing configuration if no configuration is found (`-- cluster-config-dir` defaults to locators working directory). 2) users have to leave `load-cluster-configuration-dir=false` when specifying a directory for persistent region to be used. Otherwise the existing configuration is wiped out by the newly started locator as it finds the directory provided by `-- cluster-config-dir` is empty. (here user's intent to provide a specific directory is to create the disk store and not to load configuration from it). Unlike issue #1, users does not need to be cautious in this case as the default value for load-cluster-configuration-from-dir is 'false'. Its not very intuitive how these two parameters work together, so in favor of simplicity this command option will be deprecated and users can rely on 'import cluster-configuration' command to import configuration while bootstrapping a cluster. was (Author: sboorlagadda): Instead of failing the command and showing errors, the option itself will be deprecated. Currently this option takes (true/false, defaults to false) to let locator load cluster configuration from a specified directory provided with other option '--cluster-config-dir'. Also `--cluster-config-dir` is used to create the persistent disk store to store configuration region entries. There are couple of issues on how these two parameters work together. When starting a locator to join an existing cluster - 1) if option `--load-cluster-config-from-dir` is set to true, then users have to provide a directory to load the configuration, failing to provide `--cluster-config-dir` would cause the newly started locator to wipe out existing configuration if no configuration is found (`--cluster-config-dir` defaults to locators working directory). 2) users have to leave `load-cluster-configuration-dir=false` when specifying a directory for persistent region to be used. Otherwise the existing configuration is wiped out by the newly started locator as it finds the directory provided by `--cluster-config-dir` is empty. (here user's intent to provide a specific directory is to create the disk store and not to load configuration from it). Unlike issue #1, users does not need to be cautious in this case as the default value for load-cluster-configuration-from-dir is 'false'. Its not very intuitive how these two parameters work together, so in favor of simplicity this command option will be deprecated and users can rely on 'import cluster-configuration' command to import configuration while bootstrapping a cluster. > Loading cluster configuration from a dir that does not have complete CC will > throw NPE > -------------------------------------------------------------------------------------- > > Key: GEODE-3237 > URL: https://issues.apache.org/jira/browse/GEODE-3237 > Project: Geode > Issue Type: Bug > Components: configuration, gfsh > Reporter: Jinmei Liao > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > We should handle the error more gracefully and informatively. Currently if > user did the following: > gfsh> start locator --name=locator > gfsh> shutdown --include-lcoator=true > gfsh> start locator --name=locator --load-cluster-configuration-from-dir=true > the console message says "Cluster configuration service has been started, but > its not running yet", > and there is an NPE in the log: > [error 2017/07/18 10:22:38.357 PDT locator <Pooled Message Processor 1> > tid=0x41] null > java.lang.NullPointerException > at > org.apache.geode.distributed.internal.ClusterConfigurationService.loadSharedConfigurationFromDisk(ClusterConfigurationService.java:618) > at > org.apache.geode.distributed.internal.ClusterConfigurationService.initSharedConfiguration(ClusterConfigurationService.java:441) > at > org.apache.geode.distributed.internal.InternalLocator$SharedConfigurationRunnable.run(InternalLocator.java:613) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at > org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:665) > at > org.apache.geode.distributed.internal.DistributionManager$4$1.run(DistributionManager.java:922) > at java.lang.Thread.run(Thread.java:745) > The error message if no directory is specified, should be saying: > {code:java} > The option load-cluster-configuration-from-dir=true is specified but the > option -cluster-config-dir needs to be set with a directory to the cluster > config file.{code} > The error message if the directory is specified but cluster config file is > not found in that directory: > {code:java} > No cluster configuration is found in <specified directory>{code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)