There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-6ac2af41-1c4b-4add-8045-e3e3913a4e99 XWIKI-25423 Open

Refuse to migrate a Solr core created with a Solr major version older than the previous one, and indicate the intermediate XWiki version to upgrade to first

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-9390b46e-96ea-4023-bb33-8f4a7739a4c4 Changes by Thomas Mortagne on 22/Oct/26 10:51
 
Description: Lucene can only open an index whose *creation* version is at most one major version older than itself: an index created with Lucene N-2 is refused, even if every segment was rewritten since by Lucene N-1.

The Solr core migration added in XWIKI-19813 (see {{AbstractSolr#migrateCore}}) looks for a previous core from {{solrMajorVersion - 1}} down to {{8}} and migrates the first one it finds. When the only existing core is two (or more) Solr major versions older than the current one, which happens when an instance upgrades straight from an XWiki version based on Solr N-2 to one based on Solr N, the migration tries to read a core that the current Solr cannot open, and fails with a low level Lucene error.

This situation
will can already appear as soon as XWiki moves to with a remote Solr 10 , server (supported since XWIKI-24326): whatever the Solr major version the XWiki cores are designed for instances , it's the Lucene version of the server which opens them, so the Solr 8 cores of an instance which never ran an XWiki version based on Solr 9 (i cannot be migrated . e. still using Solr 8 cores). It affects both will also appear with the embedded and the remote Solr setups, since as soon as XWiki moves to Solr 10. XWiki performs the migration in both cases setups (with a remote Solr, the administrator only creates the new empty cores).

h2. Proposal

* Detect, before trying to read it, that the previous core found is older than the previous Solr major version (the Solr major version is part of the core name), and refuse to migrate it.
* Report a clear error explaining that the Solr data cannot be migrated directly, and indicating the XWiki version to upgrade to first (the last XWiki version based on the intermediate Solr major version), before upgrading to the target version.
* Maintain a mapping between each Solr major version and the latest XWiki version based on it, to compute the right upgrade steps. For example, Solr 8: XWiki 16.1.x (or 15.10.x LTS), Solr 9: the last XWiki version before the move to Solr 10.
*
With a remote Solr, the version to compare the previous core with is the major version of the Solr server, not the one the XWiki cores are designed for (see XWIKI-25429), and the error should tell to first migrate the cores with a Solr server of the intermediate major version.
*
The search core is not concerned, since it's recreated and reindexed from the database when the Lucene version changes.