[
https://issues.apache.org/jira/browse/SOLR-7271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gregory Chanan updated SOLR-7271:
---------------------------------
Attachment: SOLR-7271.patch
Here's a patch that writes out two fields in the clusterstate:
- #1 the new format
- #2 the old format if possible (otherwise the new format -- in which case the
old client will throw the above exception b/c of the format change, but that
seems okay because a new feature is being used).
By default #1 is "router" and #2 is "routerOld" so there is no behavior change
by applying this patch, besides writing out some additional info. If upgrading
from a Solr-4.4 cluster, you can set system properties to rename these to e.g.
#1 "routerSpec" and #2 "router" so that old clients can read the old format and
new clients can read the new format. I've tested this on a cluster with 4.4
clients and haven't experienced any issues.
I'm undecided if this should be committed since the class of users upgrading
from 4.4 to 4.10.5 is probably pretty small, but I thought I'd at least put
this up here for completeness (we are using this at Cloudera because we have
versions of the software that support upgrading from 4.4 to 4.10). I'm open to
hear opinions on committing this vs not.
> 4.4 client to 4.5+ server compatibility Issue due to DocRouter format
> ---------------------------------------------------------------------
>
> Key: SOLR-7271
> URL: https://issues.apache.org/jira/browse/SOLR-7271
> Project: Solr
> Issue Type: Bug
> Components: SolrCloud
> Affects Versions: 4.5
> Reporter: Gregory Chanan
> Assignee: Gregory Chanan
> Fix For: 4.10.5
>
> Attachments: SOLR-7271.patch
>
>
> SOLR-4221 changed the router format from e.g.:
> {code}
> ...
> "router":"compositeId”,
> ...
> {code}
> to:
> {code}
> ...
> "router":{"name":"compositeId"},
> ...
> {code}
> This later commit:
> https://github.com/apache/lucene-solr/commit/54a94eedfd5651bb088e8cbd132393b771f5f5c2
> added backwards compatibility in the sense that the server can read the old
> router format. But the old 4.4 client can't read the new format, e.g. you
> get:
> {code}
> org.apache.solr.common.SolrException: Unknown document router
> '{name=compositeId}'
> at
> org.apache.solr.common.cloud.DocRouter.getDocRouter(DocRouter.java:46)
> at
> org.apache.solr.common.cloud.ClusterState.collectionFromObjects(ClusterState.java:289)
> at org.apache.solr.common.cloud.ClusterState.load(ClusterState.java:257)
> at org.apache.solr.common.cloud.ClusterState.load(ClusterState.java:233)
> at
> org.apache.solr.common.cloud.ZkStateReader.createClusterStateWatchersAndUpdate(ZkStateReader.java:357)
> at com.cloudera.itest.search.util.ZkExecutor.<init>(ZkExecutor.java:39)
> at
> com.cloudera.itest.search.util.SearchTestBase.getZkExecutor(SearchTestBase.java:648)
> at
> com.cloudera.itest.search.util.SearchTestBase.setupSolrURL(SearchTestBase.java:584)
> at
> com.cloudera.itest.search.util.SearchTestBase.setupEnvironment(SearchTestBase.java:371)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]