Current state: Under discussion
Discussion thread: here (<- link to https://mail-archives.apache.org/mod_mbox/lucene-dev/)
JIRA:
Released: <Solr Version>
Please keep the discussion on the mailing list (or in Jira) rather than commenting on the wiki (wiki discussions get unwieldy fast). Confluence supports inline comments that can also be used.
Current cluster-level configuration uses a hodgepodge of traditional Solr config sources (solr.xml, system properties) and the new somewhat arbitrary config files kept in ZK (/clusterprops.json, /security.json, /packages.json, /autoscaling.json etc...).
There's no uniform strongly-typed API to access and manage these configs - currently each config source has its own CRUD, often relying on direct access to Zookeeper. There's also no uniform method for monitoring changes to these config sources.
This caused the situation where different Solr component authors had to come up with their own solutions, in many cases directly accessing ZK + watches.
The scope of this SIP is to define a new uniform cluster-level configuration API, mostly for internal purposes, to be consumed by various Solr components.
Most of the design will be related to the internal APIs but there will be also a public CRUD API to manipulate the configs.
This SIP proposes a uniform config API facade with the following characteristics:
The API will offer a single facade interface (eg. ClusterConfig ) that will allow to retrieve and set strongly-typed instances of subsystem configurations.
Individual configurations need to be versioned (eg. timestamped). Since initially the primary backing store will be ZK we will get this information for free from zkVersion.
For example:
public interface VersionedConfig {
// monotonically increasing version number
long getVersion();
}As an example, container-level plugins configuration could be defined in a PluginConfigs POJO and then it could be accessed like this:
ClusterConfig clusterConfig = ...
...
PluginConfigs containerPluginConfigs = clusterConfig.get("container/plugins", PluginConfigs.class);
... // modify the configuration
clusterConfig.set("container/plugins", containerPluginConfigs);
Components may register as listeners to the respective configuration path in order to receive notifications about updates:
public interface ClusterConfigListener<T extends VersionedConfig> {
void onChange(T oldConfig, T newConfig);
}
...
clusterConfig.registerListener("container/plugins", listener);Describe how this proposal affects security. Will this SIP expose Solr to new attack vectors? Will it be necessary to add new permissions to the security framework due to this SIP?
Describe in few sentences how the SIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.