SOLR-15145: solr.storeBaseUrl feature flag introduced in 8.8.1 should default to false for 9.x

This commit is contained in:
Timothy Potter 2021-02-11 12:50:29 -07:00 committed by GitHub
parent b6db6c88d7
commit 8662121ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 12 deletions

View File

@ -238,13 +238,21 @@ Bug Fixes
---------------------
* SOLR-15078: Fix ExpandComponent behavior when expanding on numeric fields to differentiate '0' group from null group (hossman)
* SOLR-15114: Fix bug that caused WAND optimization to be disabled in cases where the max score is requested (such as
multi-shard requests in SolrCloud) (Naoto Minami via Tomás Fernández Löbbe)
Other Changes
---------------------
* SOLR-15118: Deprecate CollectionAdminRequest.getV2Request(). (Jason Gerlowski)
================== 8.8.1 ==================
Bug Fixes
---------------------
* SOLR-15145: System property to control whether base_url is stored in state.json to enable back-compat with older SolrJ versions.
(Timothy Potter)
* SOLR-15114: Fix bug that caused WAND optimization to be disabled in cases where the max score is requested (such as
multi-shard requests in SolrCloud) (Naoto Minami via Tomás Fernández Löbbe)
================== 8.8.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -164,6 +164,15 @@ See for example https://lucene.apache.org/solr/guide/8_5/cluster-node-management
== Configuration and Default Parameter Changes in Solr 9
* base_url removed from stored state*
If you're able to upgrade SolrJ to 8.8.x for all of your client applications, then you can set `-Dsolr.storeBaseUrl=false` (introduced in Solr 8.8.1)
to better align the stored state in Zookeeper with future versions of Solr; as of Solr 9.x, the `base_url` will no longer be
persisted in stored state. However, if you are not able to upgrade SolrJ to 8.8.x for all client applications, then you should
set `-Dsolr.storeBaseUrl=true` so that Solr will continue to store the `base_url` in Zookeeper. For background, see: SOLR-12182 and SOLR-15145.
Support for the `solr.storeBaseUrl` system property will be removed in Solr 10.x and `base_url` will no longer be stored.
=== Schema Changes in 9
=== Authentication & Security Changes in Solr 9

View File

@ -100,6 +100,16 @@ The default Prometheus Exporter configuration includes metrics like queries-per-
Plugin developers using `SolrPaths.locateSolrHome()` or 'new `SolrResourceLoader`' should check deprecation warnings as existing some existing functionality will be removed in 9.0.
https://issues.apache.org/jira/browse/SOLR-14934[SOLR-14934] has more technical details about this change for those concerned.
*base_url removed from stored state*
As of Solr 8.8.0, the `base_url` property was removed from the stored state for replicas (SOLR-12182). If you're able to upgrade SolrJ to 8.8.x
for all of your client applications, then you can set `-Dsolr.storeBaseUrl=false` (introduced in Solr 8.8.1) to better align the stored state
in Zookeeper with future versions of Solr. However, if you are not able to upgrade SolrJ to 8.8.x for all client applications,
then leave the default `-Dsolr.storeBaseUrl=true` so that Solr will continue to store the `base_url` in Zookeeper.
You may also see some NPE in collection state updates during a rolling upgrade to 8.8.0 from a previous version of Solr. After upgrading all nodes in your cluster
to 8.8.0, collections should fully recover. Trigger another rolling restart if there are any replicas that do not recover after the upgrade to re-elect leaders.
=== Solr 8.7
See the https://cwiki.apache.org/confluence/display/SOLR/ReleaseNote87[8.7 Release Notes^]

View File

@ -35,6 +35,13 @@ import static org.apache.solr.common.util.Utils.toJSONString;
*/
public class ZkNodeProps implements JSONWriter.Writable {
/**
* Feature flag to enable storing the 'base_url' property; base_url will not be stored as of Solr 9.x.
* Installations that use an older (pre-8.8) SolrJ against a 8.8.0 or newer server will need to set this system
* property to 'true' to avoid NPEs when reading cluster state from Zookeeper, see SOLR-15145.
*/
static final boolean STORE_BASE_URL = Boolean.parseBoolean(System.getProperty("solr.storeBaseUrl", "false"));
protected final Map<String,Object> propMap;
/**
@ -45,7 +52,7 @@ public class ZkNodeProps implements JSONWriter.Writable {
// don't store base_url if we have a node_name to recompute from when we read back from ZK
// sub-classes that know they need a base_url (Replica) can eagerly compute in their ctor
if (this.propMap.containsKey(ZkStateReader.NODE_NAME_PROP)) {
if (!STORE_BASE_URL && this.propMap.containsKey(ZkStateReader.NODE_NAME_PROP)) {
this.propMap.remove(ZkStateReader.BASE_URL_PROP);
}
@ -118,14 +125,9 @@ public class ZkNodeProps implements JSONWriter.Writable {
@Override
public void write(JSONWriter jsonWriter) {
// don't write out the base_url if we have a node_name
if (propMap.containsKey(ZkStateReader.BASE_URL_PROP) && propMap.containsKey(ZkStateReader.NODE_NAME_PROP)) {
final Map<String,Object> filtered = new HashMap<>();
// stream / collect is no good here as the Collector doesn't like null values
propMap.forEach((key, value) -> {
if (!ZkStateReader.BASE_URL_PROP.equals(key)) {
filtered.put(key, value);
}
});
if (!STORE_BASE_URL && propMap.containsKey(ZkStateReader.BASE_URL_PROP) && propMap.containsKey(ZkStateReader.NODE_NAME_PROP)) {
final Map<String,Object> filtered = new HashMap<>(propMap);
filtered.remove(ZkStateReader.BASE_URL_PROP);
jsonWriter.write(filtered);
} else {
jsonWriter.write(propMap);